问题一:安卓模拟器启动失败
报错信息:Android Studio - Unrecognized VM option 'MaxPermSize=256m'
解决办法:Change -XX:MaxPermSize to -XX:MaxMetaspaceSize solve my problem.
备注:-XX:MaxPermSize was deprecated in JDK 8, marked as obsolete in JDK 16, and removed in JDK 17. It was superseded by the -XX:MaxMetaspaceSize option.
问题二:安卓模拟器启动失败
报错信息: What went wrong:Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_INSUFFICIENT_STORAGE
解决办法:提示了模拟器内存不足,需要清空模拟器内存后再重新安装
问题三:安卓打包失败
报错信息:
Could not download okhttp-3.12.0.jar (com.squareup.okhttp3:okhttp:3.12.0): Skipped due to earlier error
Failed to list versions for com.facebook.react:react-native....
解决办法:Just disconnect from your internet and build your project, once the build is complete and the app launches you can connect back.
问题四:安卓投研项目模拟器启动失败
报错信息:
Unrecognized VM option 'MaxPermSize=1024m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
解决办法:删除-XX:MaxPermSize=1024m
stackoverflow.com/questions/3…
问题五:安卓投研项目模拟器启动失败,打包同样也报错
报错信息:
- What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'
解决方法:
在android/build.gradle中添加如下代码
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
// NOTE: if you are in a monorepo, you may have "$rootDir/../../../node_modules/react-native/android"
url "$rootDir/../node_modules/react-native/android"
}
}
问题六:IOS模拟器启动失败
报错信息:
解决办法:clean project,重新run build
问题七:IOS模拟器启动失败
报错弹窗文案:Unable to lookup in current state: Shutdown
解决办法:
第一步. Open Xode and select Preferences > Locations. 1
第二步. Once the preference pane is open, click on the arrow next to /Xcode/DerivedData. This should open a finder window. 2
第三步. Delete all sub-directory within the DerivedData folder
第四步. Close Xcode and clean build app to install on iOS device
参考链接:stackoverflow.com/questions/6…
问题八:IOS打包报错
报错信息:
解决办法: