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.
Related
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<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="https"/>
<data android:host="flutterbooksample.com"/>
</intent-filter>
Using deep links to open app default but it opens browser default
In Android 11 or less it works what we expected
In Android 12 it only opens browser as default
If your deep link URL looks like https://abc.page.link/services
where services is the deep-lined page
Change <data android:host="example.host"/> to <data android:host="abc.page.link"/>
Make sure to restart the app.
I had created the default(counter) app from flutter and this works perfectly in terms of appearing on the app list as an icon just like any other normal app. However, as i continue adding files to it for example plugins, added firebase too, I rebuild it and the app launches but the app icon does not show on the app list on the phone.
Now am wondering if this is a bug on flutter sdk or what has happened. Since previously I was using flutter version 2.2.2 and now am on flutter 2.5.0
I figured it out I think. The problem is in the android/app/src/main/AndroidManifest.xml. I believe you need to include the following tag in your intent-filters:
<category android:name="android.intent.category.LAUNCHER"/>
However, I had some tags overwriting this one and this is what broke the visibility in the app drawer. My intent filters now look as follows and everything is working now:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<!-- <action android:name="android.intent.action.VIEW" /> -->
<category android:name="android.intent.category.DEFAULT" />
<!-- <category android:name="android.intent.category.BROWSABLE" /> -->
<!-- <data android:scheme="my.test.app" /> -->
</intent-filter>
Hope this helps.
Deployed Flutter application to Google Play Store but it's stuck at the splash screen and never open
I did match my AppID and still facing the same issue
Here is my manifest.xml:
<!-- TODO: Changed by Parveen Before merge 1 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mrbox.store">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--
io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here.
-->
<!-- TODO: Add By Parveen before merge 1 -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Mr.Box Store"
android:usesCleartextTraffic="true"
android:icon="#mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!--
Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI.
-->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!--
Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame.
-->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!--
TODO: Changed by parveen before merge 1
android:name="default-url"
android:value="https://inspireui.com"
-->
<meta-data
android:name="default-url"
android:value="https://www.mrboxstore.com" />
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- TODO: Changed by parveen before merge 1 android:value="inspireui.com" -->
<data android:scheme="https"
android:host="mrboxstore.com" />
<data android:scheme="http" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/logo" />
<!--
Set color used with incoming notification messages. This is used when no color is set for the incoming
notification message.
-->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/notiColor" />
<!-- Google map and Admod setup -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/api_key" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/admob_api" />
<!-- Facebook Login configuration -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:exported="true" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!--
Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
-->
<meta-data android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Things to try
Make sure flutter doctor -v runs without ANY complaints
Edit android/gradle.properties and add the flag: android.bundle.enableUncompressedNativeLibs=false
Do a flutter clean command
Try creating a release build using flutter build appbundle
Test Locally / Offline
download bundletool
Generate a set of APKs from your app bundle, following this guide
Deploy the app to your connected device(s) following this Guide
Works?
Upload your bundle to Google Play using the internal test track, or the alpha or beta channels to test the bundle before releasing it in production
Instructions for doing this can be found here
Good Luck :)
Because it is not working after uploading on google play. then there might be some issue with your app signing. You can follow the steps here
I have faced issues like this when I used facebook login sdk, so I would suggest checking following:
Check if you have signed the apk/appbundle with proper release keystore
Check if you have opt in for google's automatic signing on playstore while deploying app
2.1 If yes then it will change the sha-1 value which is used in facebook app for authentication, for it to work use the one generated by google in playstore
Assuming that you publish an App Bundle (.aab file) the issue can be related to the format itself since it is not testable via IDE. E.g. when running the app in Release mode on a device .apk is created and provisioned to it, not .aab.
What I did in the past to troubleshoot .aab (also had failures only with GPlay version, local Debug and Release modes worked fine) was to use Firebase Test Lab. You can run automated monkey tests on 5 physical devices and 15 virtual devices every day free-of-charge. Just log in to Firebase Console, cretae an empty project, go to Test, upload your .aab file, select devices (it's worth also to choose different locales) and wait for completion. After that check logs in test results, you might find answers there (in my cases there was an issue with localization resources which got broken while producing .aab release package).
This option can be esier/faster than splitting .aab locally with comand line into APKs and testing on a local device.
In my experience, try to check your database(sqlite) if created. Try to replace the path and check if the database is created properly.
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.
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>