I am currently trying to do it using clean react native project. I followed official android instant apps guides.
What I did to turn react-native into Android Instant Apps
Renamed
app
module tobase
moduleRemoved
splits
andapplicationVariants
inbuild.gradle
Created
installed
module andinstantApp
module.Added
import OutputFile
,entryFile
, andapply from react.gradle
insideinstalled
module
However, I am running into following problems.
react-native run-android
fails because it is still looking for app module.- Running
instantApp
from Android Studio will run the app on my phone, but failing to download JS from my React metro bundler even after running it manually and executingadb reverse tcp:8081 tcp:8081
- Renaming base module back to app module and running react-native run-android still fails with error message Error: Activity class {com.instantapp/com.instantapp.MainActivity} does not exist.
I tried searching everywhere but couldn't find a solution.