gpt4 book ai didi

android - 意外的顶级异常( react native )

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:01:58 26 4
gpt4 key购买 nike

我在构建我的项目时遇到了这个错误,它是一个 react-native 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)

这是我的gradle:

`申请自:“react.gradle”适用于:“../../node_modules/react-native-vector-icons/fonts.gradle”

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

安卓{ 编译SDK版本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, release
applicationVariants.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
}
}
}

依赖关系{
编译文件树(目录:“libs”,包括:[“*.jar”])
编译“com.android.support:appcompat-v7:23.0.1”
编译“com.facebook.react:react-native:+”//来自 node_modules
编译项目(':react-native-vector-icons')
编译项目(':react-native-share')
}

我已经安装了所有需要的依赖项(google 存储库,...),删除了构建文件夹,但我总是收到此错误。

如果您有任何链接或提示,谢谢!而且我无法发布唯一代码,Stack overflow 不会这样做,grrrrr!

最佳答案

问题解决了!做了一些更改,然后 cd android/&& ./gradlew clean 修复了它!

关于android - 意外的顶级异常( react native ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37657973/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com