我是Android应用程序开发的新手,但我正在建立一个AR应用程序,也使用滑动从网站选择一件艺术品,然后使用AR挂在墙上。
我得到“生成主要dex列表时出错”,我不知道为什么。
我已经构建了主应用程序,然后从wikitude导入了AR部分,所以我想知道这是否会造成冲突。
我不确定向您展示的最佳方式是将项目上传到某处然后让某人查看它吗?
提前致谢
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "codingwithmitch.com.recyclerview"
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
dexOptions {
javaMaxHeapSize "4g"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation (name: 'wikitudesdk', ext:'aar' )
implementation project(':arapp')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//recyclerview
implementation 'com.android.support:recyclerview-v7:27.1.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
//circle imageview
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'androidx.multidex:multidex:2.0.0'
}
这是针对增强现实部分的
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "8.0.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'wikitudesdk', ext: 'aar')
implementation 'com.google.ar:core:1.1.0'
}
repositories {
flatDir{
dirs 'libs'
}
}
也许你可以尝试这个,我不确定它是否会起作用:
//In your app gradle file, inside "android":
dexOptions {
javaMaxHeapSize "4g"
}
//Also in your app gradle file, inside "dependencies":
implementation 'androidx.multidex:multidex:2.0.0'