首页 > 解决方案 > How to change release variant to debug variant?

问题描述

I have downloaded the Shuttle Music Player from GitHub and stuck with this problem while syncing project with Gradle. How can I fix this problem??

//This is the Module Gradle

import dependencies.Dependencies

apply plugin: Dependencies.BuildPlugins.androidLibrary

android {
    compileSdkVersion Dependencies.compileSdk

    defaultConfig {
        minSdkVersion Dependencies.minSdk
        targetSdkVersion Dependencies.targetSdk
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation Dependencies.Google.appcompat
}

//This the App Gradle

import dependencies.Dependencies

apply plugin: Dependencies.BuildPlugins.androidLibrary

android {
    compileSdkVersion Dependencies.compileSdk

    defaultConfig {
        minSdkVersion Dependencies.minSdk
        targetSdkVersion Dependencies.targetSdk
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation Dependencies.Google.appcompat
}

WARNING: Module 'navigation' has variant 'debug' selected, but the module ''app'' depends on variant 'release' Select 'navigation' in "Build Variants" window Fix problem

标签: androidandroid-studio

解决方案


在你的 android studio 中有一个选项卡构建变体(通常在文件视图的左侧),在那里你会看到选择了每个依赖项的变体。尝试更改它以查看“导航”是否具有发布变体。此外,您的应用在 buildTypes 中缺少调试变体,这导致应用使用发布变体。尝试向您的应用程序添加调试变体,然后检查它是否使用调试构建。


推荐阅读