问题
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