美文网首页
To run dex in process, the Gradl

To run dex in process, the Gradl

作者: IDO0 | 来源:发表于2017-11-27 10:55 被阅读0次

andorid studio 运行正常,通过命令行react-native run-android 报错。
如图:


android1024.png

解决:
1:app下build.gradle修改

  defaultConfig {
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0.1"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "2g"
        preDexLibraries = false;
    }

2:项目目录下gradle.properties添加

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2560m 

至于2560这个数字根据它提示的修改。
然后编译同步gradle
react-native run-android.
成功。

相关文章

网友评论

      本文标题:To run dex in process, the Gradl

      本文链接:https://www.haomeiwen.com/subject/ctmrbxtx.html