react-native 纪录一下遇到的坑

开发运行之时

一、

Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your Android development environment:

解决办法:

react-native项目进入到android目录后,执行gradle clean命令

 

 

 

打包android的apk时

一、

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

分析原因:
分配的内存太小
解决办法:
把build.gradle中的
dexOptions {
        preDexLibraries = false 

        javaMaxHeapSize "4g"   //这个改大

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章