1.错误:Could not expand/create/delete/read
解决:cd android ./gradlew clean
2. Requiring unknown module "490".If you are sure the module is there, try restarting Metro Bundler. You may also want to run `yarn`, or `npm install` (depending on your environment). unknownModuleError
原因:编译成功跑起来之后,手动在项目目录中增删了一些文件,
解决:gradlew clean一下,重新编译
3. com.android.dex.DexIndexOverflowException: Cannot merge new index 66497 into a non-jumbo instruction!问题
解决:到android/app/build.gradle文件中,增加dexOptions:
android: {
......
dexOptios: {
jumboMode true
}
}
4. 打包时,报Multiple dex files define {包名}BuildConfig错误
解决: 同上,到dexOptions中添加如下字段:
dexOptions {
preDexLibraries = false
}
详情:https://stackoverflow.com/questions/25103288/multiple-dex-files-define-my-package-buildconfig-cant-find-the-cause
最后
以上就是拉长小鸽子最近收集整理的关于React Native踩坑记录的全部内容,更多相关React内容请搜索靠谱客的其他文章。
发表评论 取消回复