gpt4 book ai didi

android - 模块 'base' 没有 dex 文件,但 AndroidManifest.xml 中的属性 'hasCode' 未设置为 false

转载 作者:行者123 更新时间:2023-11-30 05:12:04 24 4
gpt4 key购买 nike

Android 应用程序 bundle 工具抛出上述错误。

这是我的应用级别gradle

apply plugin: 'com.android.application'
apply plugin: 'dexguard'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'


android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion '28.0.3'


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// dynamic feature APK.
enableSplit = false
}
density {
// This property is set to true by default.
enableSplit = true
}
abi {
// This property is set to true by default.
enableSplit = true
}
}


defaultConfig {

applicationId "com.xxxxx.xxxxx"
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
resConfigs "en", "hi", "ta"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
return true
}

buildTypes {
debug {

proguardFile getDefaultDexGuardFile('dexguard-debug.pro')
proguardFile 'dexguard-project.txt'

return true
}
release {

proguardFile getDefaultDexGuardFile('dexguard-release.pro')
proguardFile 'dexguard-project.txt'

return true
}
}


return true

}

dependencies {
// playServices
implementation "com.google.android.gms:play-services-maps:16.0.0"
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-ads:17.0.0"
implementation "com.google.firebase:firebase-config:16.1.0"
implementation "com.google.firebase:firebase-appindexing:16.0.2"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'

// supportLibrary
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:customtabs:$supportLibraryVersion"
implementation "com.android.support:support-media-compat:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation 'com.google.android.instantapps:instantapps:1.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'

implementation 'com.android.support:multidex:1.0.3'

// Third party
// Others are here

}

apply plugin: 'com.google.gms.google-services'

最佳答案

发现问题:

如果这只发生在发布版本中,那么它可能是 proguard 问题。如果 Proguard 认为这些文件无用,则会从动态模块中删除这些文件。所以,你必须修改 proguard keep 规则。

在混淆文件中-保留类 whateverpackagename. { *; }**

附言还要检查 multidex 功能是否启用。

关于android - 模块 'base' 没有 dex 文件,但 AndroidManifest.xml 中的属性 'hasCode' 未设置为 false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53551669/

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