Android Studio 3.0 RC2 - “Default Activity not found” for multi module project

本小妞迷上赌 提交于 2019-11-28 10:29:55

问题


I have a multi-module project (supporting instant apps and installed app). When using AS 3.0 RC1 and RC2 I'm no longer able to launch app....getting

Default Activity not found

I have a number of product flavors and issue could be related to fact that appropriate LAUNCHER activity is declared in AndroidManifest.xml for each flavor (I have chosen one of those flavors in "Build Variants" section). This has been working fine up to AS 3.0 Beta 7.


回答1:


Not sure how I didn't spot this but when viewing AndroidManifest.xml for apk module you can click on "Merged Manifest" tab which shows something like following:

Merging Errors: Error: Attribute provider#com.google.firebase.provider.FirebaseInitProvider@authorities value=(somepackage.base.firebaseinitprovider) from AndroidManifest.xml:69:29-108 is also present at AndroidManifest.xml:10:13-72 value=(somepackage.firebaseinitprovider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:69:19-224 to override

I "fixed" this by adding following to base module AndroidManifest.xml

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

I'm still not clear though on why this only happens when running from Android Studio.



来源:https://stackoverflow.com/questions/46862821/android-studio-3-0-rc2-default-activity-not-found-for-multi-module-project

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