Home » Android » Android Instant App : Default Activity not found

Android Instant App : Default Activity not found

Posted by: admin May 14, 2020 Leave a comment

Questions:

This seems to be manifest merging error. I’m trying to port existing code to instant app module. What I’ve tried is :

  1. Changed main app module to baseFeatureModule.
  2. Created a new module completeApp.
  3. Emptied completeAppModule’s Manifest :

  4. added implementation project entry in completeAppModule

    implementation project (“:udofy”)

  5. Added these entries in base module :

    baseFeature true in android block

    application project (“:fullModule”) in dependencies

I’ve tried rebuilding/ invalidate cache and restart/ Restarting studio but no help. Can anybody help me out here?

How to&Answers:

Based from this thread, there is no sources tab in later versions of Android Studio. However, you can edit the build.gradle file instead. See this link. Also make sure that you have specified the default activity in your AndroidManisfest.xml file. Within your default activity’s xml section, there should be these tags:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

Answer:

The issue for me was that I was using crashlytics and another debug utility that do not play well with instant apps. This was causing the manifest merging to fail. When I removed Crashlytics and the other utility, the manifest for the APK was able to be successfully generated and Android Studio was able to find the default activity which was present in the base feature.

Answer:

I figured out, that the Manifest merger failed with the Firebase plugin in the base module.

Option 1:

I fixed this by adding following to the base modules ‘AndroidManifest.xml’.

<provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="mypackage.firebaseinitprovider"
        android:exported="false"
        tools:node="merge"/>

Don’t forget to replace mypackage.

Option 2:

Copy the whole <application ...>...</application> tag into app modules AndroidManifest.xml