我构建项目时出现此错误,它是一个反应原生的android项目:
UNEXPECTED top-LEVEL EXCEPTION : com.androID.dex.DexException: Multiple dex files define LandroID/support/v7/app/Actionbar$Callback; at com.androID.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.androID.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.androID.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.androID.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.androID.dx.merge.DexMerger.merge(DexMerger.java:188) at com.androID.dx.command.dexer.Main.mergelibraryDexBuffers(Main.java:439) at com.androID.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.androID.dx.command.dexer.Main.run(Main.java:230) at com.androID.dx.command.dexer.Main.main(Main.java:199) at com.androID.dx.command.Main.main(Main.java:103)
这是我的傻瓜:
`apply from:“react.gradle”
申请自:“../../node_modules/react-native-vector-icons/Fonts.gradle”
def enableSeparateBuildPercpuArchitecture = false
def enableProguardInReleaseBuilds = false
androID {
compileSdkVersion 23
buildToolsversion“23.0.1”`
defaultConfig { applicationID "com.movIEproject" minSdkVersion 16 targetSdkVersion 22 versionCode 1 versionname "1.0" ndk { abiFilters "armeabi-v7a","x86" }}signingConfigs { release { }}splits { abi { reset() enable enableSeparateBuildPercpuArchitecture universalApk false // If true,also generate a universal APK include "armeabi-v7a","x86" }}buildTypes { release { MinifyEnabled enableProguardInReleaseBuilds proguardfiles getDefaultProguardfile("proguard-androID.txt"),"proguard-rules.pro" }}// applicationVariants are e.g. deBUG,releaseapplicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture,set a unique version code as described here: // http://tools.androID.com/tech-docs/new-build-system/user-guIDe/apk-splits def versionCodes = ["armeabi-v7a":1,"x86":2] def abi = output.getFilter(Outputfile.ABI) if (abi != null) { // null for the universal-deBUG,universal-release variants output.versionCodeOverrIDe = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } }}
}
依赖{
编译filetree(dir:“libs”,包括:[“* .jar”])
编译“com.androID.support:appcompat-v7:23.0.1”
编译“com.facebook.react:react-native:”//来自node_modules
编译项目(‘:react-native-vector-icons’)
编译项目(‘:react-native-share’)
}
我已经安装了所有需要的依赖项(谷歌存储库,…),删除了构建文件夹,但我总是得到这个错误.
如果您有任何链接或提示,谢谢!而且我不能发布一个独特的代码,堆栈溢出不会这样做,grrrrr!
最佳答案问题解决了 !做了一些改变,然后cd了androID /&& ./gradlew清理修复它! 总结以上是内存溢出为你收集整理的android – 意外的顶级异常(反应原生)全部内容,希望文章能够帮你解决android – 意外的顶级异常(反应原生)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)