gpt4 book ai didi

Android Studio 项目中的 Gradle 弃用 "Relying on packaging to define the extension of the main artifact..."可以修复吗?

转载 作者:行者123 更新时间:2023-12-02 04:32:54 25 4
gpt4 key购买 nike

我想了解如何最好地使用 Android Studio,但我的经验仍然有限,尤其是在使用 Gradle 进行构建方面。

Executing tasks: [clean]

Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0 :app:clean UP-TO-DATE

BUILD SUCCESSFUL

即使一切正常,我也想避免使用已弃用的方法;

我声明我看到this question并尝试了解弃用消息,但现在我的重点是了解在 Android Studio 上构建 APK 以及如何参与由该 IDE 创建的项目。

是否可以通过更改项目中的某些内容(配置文件或工件)来修复它?

PS:我使用的是“Android Studio(预览版)0.4.3 build 133”,项目中有两个 build.gradle:

1) ~/AndroidStudioProjects/MyAppProject/app/build.gradle

apply plugin: 'android'

android {
compileSdkVersion 19
buildToolsVersion "19.0.1"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:+'
}

2) ~/AndroidStudioProjects/MyAppProject/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}

allprojects {
repositories {
mavenCentral()
}
}

和一个settings.gradle

~/AndroidStudioProjects/MyAppProject/settings.gradle

include ':app'

最佳答案

这似乎是 Android Gradle 插件中的一个错误,而不是您做错的事情;每当您在模块之一中包含依赖项时,即使指定正确,我也会看到它出现。无需担心此警告。

我已提交 https://code.google.com/p/android/issues/detail?id=65501关于这个。

关于Android Studio 项目中的 Gradle 弃用 "Relying on packaging to define the extension of the main artifact..."可以修复吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21496956/

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