Android Instant App : Default Activity not found

后端 未结 3 1356
眼角桃花
眼角桃花 2021-01-11 15:48

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 baseFeatureM
相关标签:
3条回答
  • 2021-01-11 16:35

    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

    0 讨论(0)
  • 2021-01-11 16:38

    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>
    
    0 讨论(0)
  • 2021-01-11 16:47

    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.

    0 讨论(0)
提交回复
热议问题