我目前正在尝试使用干净的React Native项目来实现它。我遵循了官方的Android Instant Apps指南。
我为将React Native转换为Android Instant Apps所做的工作:
将
app
模块重命名为base
模块在
build.gradle
中删除splits
和applicationVariants
创建
installed
模块和instantApp
模块。在
installed
模块中添加import OutputFile
、entryFile
和apply from react.gradle
然而,我遇到了以下问题:
react-native run-android
失败,因为它仍在寻找app
模块。- 从Android Studio运行
instantApp
将在我的手机上运行应用程序,但即使手动运行并执行adb reverse tcp:8081 tcp:8081
后仍无法从我的React Metro绑定器下载JS。 - 将基础模块重新命名为
app
模块并运行react-native run-android
仍然会出现错误消息:Error: Activity class {com.instantapp/com.instantapp.MainActivity} does not exist.
我尝试在各处搜索,但找不到解决方法。