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"   //這個改大

}

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