Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 将项目迁移到新的实验gradle插件大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试将我的 Android项目迁移到新的实验性gradle插件.我按照 this页的说明进行操作.我对所需文件进行了更改,但是当我尝试使用gradle文件同步项目时出错.

我的app文件夹中的build.gradle与此非常相似:

apply plugin: 'com.android.model.application'
apply plugin: 'maven'

repositories {
    maven {
        url = getBaseRepository()
        credentials {
            username = NEXUS_USERNAME
            password = NEXUS_password
        }
    }
    mavenCentral()
}

def int CACHE_LIMIT = CACHE_CHANGING_MODULES_FOR_SECONDs.toInteger()

configurations.all {
    resolutionStrategy.cachechangingModulesFor CACHE_LIMIT,'seconds'
}

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.0"

        defaultConfig.with {
            applicationId = "<myRealAppIdIsHere>"
            minSdkVersion.apiLevel = 14
            targetSdkVersion.apiLevel = 18

            multiDexEnabled = true
        }
    }

    android.buildTypes {
        debug {
            /*buildConfigField.with {
                create() {
                    type = "Boolean"
                    name = "DEBUG_BUILD"
                    value = rootProject.ext.debugBuild
                }
            }*/
        }
        release {
            minifyEnabled = false
            proguardFiles += 'proguard-rules.pro'
            /*buildConfigField.with {
                create() {
                    type = "Boolean"
                    name = "DEBUG_BUILD"
                    value = rootProject.ext.releaseBuild
                }
            }*/
        }
    }
}


dependencies {
    // my dependencies are here...
}

有人知道问题出在哪里吗?我不知道为什么错误消息包含有关ProductFlavor的问题,因为我的项目没有味道……

updatE

我试图清理我的项目 – 清理不成功,但清理过程中的错误消息更具体:

但我仍然不知道如何解决它.

解决方法

如果这不是项目中的真实文件,请确保您具有: @H_992_4@minSdkVersion.apiLevel targetSdkVersion.apiLevel

代替:

@H_992_4@minSdkVersion targetSdkVersion

我有同样的问题,这解决了它.

大佬总结

以上是大佬教程为你收集整理的android – 将项目迁移到新的实验gradle插件全部内容,希望文章能够帮你解决android – 将项目迁移到新的实验gradle插件所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。