Eclipse imported but default activity not found - eclipse

I just imported my eclipse project to android studio, and It studio converted everything fine. But while running the error message shows: Default Activity Not Found.
my manifest file: https://hastebin.com/yigakupoho.xml

You need to define your default activity as android.intent.action.MAIN, like that:
<activity android:name=".YourActivity" android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

Related

Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

While debugging the application in android 12, the app is getting crashed.
Android 12 require you to add a piece of code to your main activity
Go to your project folder and open AndroidManifest.xml file
Add the below code in activity
android:exported="true"
Reference:
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme">
</activity>
In AndroidManifest.xml add android:exported="true":
<manifest ...>
<application ...>
<activity
android:exported="true"
In Android 11 and lower, when declaring an Activity, Service, or Broadcast receiver in AndroidManifest, you did not explicitly declare android:exported. Since the default value is exported=true, you only need to declare exported=false when you do not want to disclose to the outside.
<activity android:name="com.example.app.backgroundService">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</activity>
Android 12 Changes: Explicit declaration of exported
Apps that set SDK API 31 (android 12) as Target sdk on Android 12 devices must explicitly declare exported in components such as Activity that declared intent-filter. Otherwise, the following error occurs and the installation fails.
Targeting S+ (version 10000 and above) requires that an explicit value for
android:exported be defined when intent filters are present
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Even for apps targeting SDK API 31, components without intent-filter can omit the exported declaration.
You must explicitly declare exported as follows:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
Intent-filter is one of the methods for exposing the app's component to the outside. This is because the component of my app can be executed through the resolving of the implicit intent.
On the other hand, there are many cases where it is used for the purpose of executing a component with an implicit intent only inside my app, but it is exposed to the outside because exported is not set, and this may affect the resolving of the implicit intent. .
Thanks #rahul-kavati.
For Xamarin/MAUI it is a property on ActivityAttribute, used like this [Activity(Label = "MsalActivity", Exported = true)]
In Xamarin.Android I faced the same in BroadcastReceiver:
[BroadcastReceiver(Enabled = true, Exported =true)]
[IntentFilter(new[] { BluetoothDevice.ActionFound, BluetoothDevice .ActionUuid, BluetoothDevice .ExtraRssi})]
public class BleReceiver : BroadcastReceiver
and solved with the same Exported=true
The fastest way is to modify the targetSdkVersion in app/build.gradle, the maximum is 30
In AndroidManifest.xml
<activity
android:exported="true"
android:name="com.YOU.APP.activities.MainActivity"
android:launchMode="singleTask"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
If you are using any intent filter or service it must have the android:export property
Currenty if you set minsdk version and get Android Error: Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined then I have sollution of that..
Open platforms/android/android.json
Put this line in all plugin you used. android:exported="true" or android:exported="false" (Based on your requirement)
Image Link => https://drive.google.com/file/d/1uAtudZf5iRXUN2tWJvgxsaWeEuZmCUqh/view?usp=sharing
After open platforms\android\app\src\main/AndroidManifest.xml file and delete the plugin activity,meta-data,service,provider..and other things under <application .......>
---Do not delete launcher activity (first activity)--
---delete other data---
Because we changed android.json line. So when we build again than It will auto generate with android:exported..
I spend my whole day in this error. But now I am happy because I got Sollution.

Ionic and phonegap barcode scanner app crash on android

My ionic app uses:
"#ionic-native/barcode-scanner": "^5.19.1",
"phonegap-plugin-barcodescanner": "^8.1.0",
Android app crashes right away when i call barcode.scan funcion. I am doing everything like on the very basic example: https://ionicframework.com/docs/native/barcode-scanner
Note: I am testing this on android7 version at the moment. The phone is not very new but still not very old neither.
It crashes right after accepting camera permissions.
There is no err message in catch block or anything, app just crashes.
Has anyone experienced this or can help me investigate more logs ?
I have found the issue, basicly it was missing com.google.zxing.client.android.SCAN from AndroidManifest.xml file:
<activity android:configChanges="orientation|keyboardHidden" android:name="com.google.zxing.client.android.CaptureActivity" android:screenOrientation="landscape" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Not sure why the plugin installation did not added anything nor it was described in github, but It was requiring activity for the manifest file.

Setting-up ARcore with Vuforia

Hi im new to Unity3d and AR, and i need to setup Arcore to use with vuforia.
i already have the " core-1.7.0.aar " file in Assets/Plugins/Android folder
and i already set the AndroidManifest.XML in the same folder as the .aar file
<application android:theme="#style/UnityThemeSelector" android:icon="#mipmap/app_icon" android:label="#string/app_name">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="unity.build-id" android:value="53bad2ba-a78a-4c14-9e44-e3d1cbb2f87c" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<!-- The following must be present to facilitate use of ARCore, if available -->
<meta-data android:name="com.google.ar.core" android:value="optional" />
</application>
and according to Vuforia Guide i need to edit the Build.gradle but i dont know How to do that from unity?
and also after i set this up, will the tracking be as good as ARcore or no?
Thank you.
You can export your project from Unity to Android Studio by selecting Export Project in the Build Settings window then press Build. Unity will ask where you want to save the output. This will give you access to all the Gradle files to follow the instructions provided by Vuforia.

Android Studio 2.0 Update Cant Run App/Theme Error

I just updated android studio to 2.0 and I can't run my themes anymore. I am getting the following error:
19:59:20 Executing tasks: [:theme:assembleDebug] 19:59:25 Gradle build
finished in 5s 506ms 19:59:28 Can't bind to local 8637 for debugger
19:59:32 Session 'theme': Error Launching activity
Could not identify launch activity: Default Activity not found Error
while Launching activity
What is wrong?
<uses-feature android:required="true" android:name="org.cyanogenmod.theme" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
<meta-data android:name="org.cyanogenmod.theme.name" android:value="#string/theme_name"/>
<meta-data android:name="org.cyanogenmod.theme.author" android:value="#string/theme_author" />
<meta-data android:name="org.cyanogenmod.theme.email" android:value="#string/theme_email" />
<application android:hasCode="false"
android:icon="#drawable/ic_launcher"
android:label="#string/theme_name"/>
Disable Instant Run to resolve this problem.
File(Ctrl + Alt + S) > Setting > Build, Execution, Deployment > Instant Run > Uncheck all checkbox option to disable.
Try:
Step 1:
File -> Invalidate Caches / Restart...
Step 2:
This is all code in `AndroidManifest.xml? You should have at least one activity that looks something like this::
<activity
android:name="com.your.package.name.YourActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This should be between:
<application> </application>

Android: Installed App icon is not visible in emulator

When I run my application code, I could see the following entry in the console:
[2011-03-01 10:29:26 - mireader] Uploading mireader.apk onto device 'emulator-5554'
[2011-03-01 10:29:26 - mireader] Installing mireader.apk...
[2011-03-01 10:29:40 - mireader] Success!
[2011-03-01 10:29:41 - mireader] Starting activity com.mireader.reader on device emulator-5554
[2011-03-01 10:29:44 - mireader] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mireader/.reader }
The application's main GUI automatically runs. Until here, there is no problem. When I get back to the application list, there my app icon is not visible. I checked in settings->application->manage application, there I could see my app and it shows uninstall option too.
What is the problem?
probably missing
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
in your main <activity> in the manifest
I had the same problem in Android Studio, with API 19 and with gradle building system. We spent a couple of hours to figure this out, and we realized, if you have more library (for example you have more test app in the same project) and you have more launcher icon in separated library, than gradle cannot solve this. You don't get any error message, just you don't see the icon.
So use different names for launcher icon or just delete which you don't need.
(I just thought, maybe someone gonna have the same problem...)
There was an other scenario as well, when icon is disappear. When you use <data android:scheme="your-own-uri">
The solution is to split intent-filter.
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="your-own-uri" />
</intent-filter>
</activity>
Just for Android noobs like myself, putting this:
<data android:scheme="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.pdf" />
between the intent filter tags of the main activity also causes an icon disappearing act. The code above is to open a file based on its extension. Remove it and the icon reappears.