Android Instant App : Default Activity not found

帅比萌擦擦* 提交于 2019-12-19 05:23:57

问题


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?


回答1:


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>



回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/46120608/android-instant-app-default-activity-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!