Android BuildConfig.Debug 在module一直为false解决方案

本文介绍如何使用Gradle在Android Studio中配置项目依赖,通过特定设置实现不同构建类型的库依赖管理。示例展示了如何在App模块中指定debug和release版本分别引用对应配置的库模块。
Execution failed for task ':app:mergeLibDexDebug'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Failed to transform debug (project :NaviServiceDataProxy) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.2, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=30, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}. > Execution failed for DexingNoClasspathTransform: D:\project\NaviService\NaviService\NaviServiceDataProxy\build\intermediates\runtime_library_classes_dir\debug. > Error while dexing. > Failed to transform debug (project :NaviServiceProxy) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.2, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=30, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime}. > Execution failed for DexingNoClasspathTransform: D:\project\NaviService\NaviService\NaviServiceProxy\build\intermediates\runtime_library_classes_dir\debug. > Error while dexing. > Failed to transform debug (project :IntelligenceSDK) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.2, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=30, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime}. > Execution failed for DexingNoClasspathTransform: D:\project\NaviService\NaviService\IntelligenceSDK\build\intermediates\runtime_library_classes_dir\debug. > Error while dexing.
10-30
Build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle' line: 2 Could not compile build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle'. > startup failed: build file 'D:\project\HDMI\VIEW_MODE_MEDIA\Media\Application\configs\platforms\android_gradle\mediafunc\build.gradle': 2: argument list must be exactly 1 literal String or String with property replacement plugins { id 'com.android.library' version agp_version } android { namespace 'com.denso.mediafunc' compileSdkVersion 32 defaultConfig { minSdkVersion 32 targetSdkVersion 32 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { testCoverageEnabled true } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } packagingOptions { exclude 'META-INF/*' exclude 'kotlin/*/*' exclude 'kotlin/*' exclude 'wm_shell_protolog.json' exclude 'META-INF/androidx.loader_loader.version' } } dependencies { implementation files('libs/directorlib.jar') compileOnly files('libs/ts-platform-library.jar') implementation files('libs/telcommonapi.jar') // compileOnly files('libs/telcommonapi-bta.jar') // compileOnly files('libs/ts-platform-library-bta.jar') compileOnly files('libs/vendor.denso.persistence-V1.0-java.jar') implementation files('libs/soundmodeservicelib.jar') api files('libs/dtvlib.jar') implementation files('libs/smartphonemanager.jar') compileOnly fileTree(dir: 'libs', include: ['*.aar']) compileOnly files('libs/android.car.jar') implementation project(path: ':mediaplugin') compileOnly files('libs/framework.jar') implementation files('libs/windowmanager-shell.jar') implementation files('libs/popupmanager.jar') implementation files('libs/radioservicelib.jar') implementation files('libs/PlayBeepplugin.jar') implementation files('libs/hdmilib.jar') implementation files('libs/displaylib.jar') //implementation 'androidx.appcompat:appcompat:1.4.1' // implementation 'com.google.android.material:material:1.6.0' implementation('androidx.palette:palette:1.0.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.arch.core", module: "core-common" exclude group: "androidx.arch.core", module: "core-runtime" exclude group: "androidx.collection", module: "collection" exclude group: "androidx.core", module: "core" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "androidx.loader", module: "loader" exclude group: "androidx.lifecycle", module: "lifecycle-livedata-core" exclude group: "androidx.lifecycle", module: "lifecycle-viewmodel" } implementation("androidx.startup:startup-runtime:1.0.0"){ exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.tracing", module: "tracing" } testImplementation('junit:junit:4.13.2') { exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test.ext:junit:1.1.3') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation('androidx.test:rules:1.4.0') { exclude group: "androidx.annotation", module: "annotation" exclude group: "androidx.lifecycle", module: "lifecycle-common" exclude group: "javax.inject", module: "javax.inject" } androidTestImplementation 'org.mockito:mockito-core:4.8.1' androidTestImplementation 'org.mockito:mockito-android:4.8.1' androidTestImplementation fileTree(dir: 'libs', include: ['*.aar', '*.jar']) }
08-27
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值