Reputation: 60061
When trying to launch the Instant App, it reported
Side loading failed with message: Failure when trying to read bundel.
Failed to parse app: /data/local/tmp/aia/my_app.zip
When look at the logcat, it has this error
InstantAppBundleException: No base split found!
Base split APK is the one with no 'splitName' attribute set on the <manifest> tag
What did I miss?
Upvotes: 0
Views: 371
Reputation: 4577
I think you may have forgetten the baseFeature tag in your base module. If you have a base module and 2 feature modules for examples your gradle should look like these (You need to pay attention to the correct plugins, the baseFeature=true tag and correct dependency declaration).
Base Module Gradle file:
apply plugin: 'com.android.feature'
android {
//this is mandatory for the base module of the project
baseFeature = true
...
}
dependencies {
...
feature project(':feature1')
feature project(':feature2')
application project(':hello-installed')
}
Feature1 module and Feature2 module Gradle files:
apply plugin: 'com.android.feature'
android {
...
}
dependencies {
...
implementation project(':base')
}
Instant App Module Gradle files:
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':base')
implementation project(':feature1')
implementation project(':feature2')
}
Full App Module Gradle files:
apply plugin: 'com.android.application'
android {
//classic gradle declaration for legacy apps
}
dependencies {
implementation project(':base')
implementation project(':feature1')
implementation project(':feature2')
//non instant libraries will only appear here
implementation project(':nonInstantLibrary')
}
Non Instant Compatible Module Gradle files:
//it will use the legacy library plugin
apply plugin: 'com.android.library'
dependencies {
...
implementation project(':base')
}
Upvotes: 2