摇篮德precation"依靠包装来定义主神器的延伸..." Android Studio中的项目可以解决吗? [英] Gradle deprecation "Relying on packaging to define the extension of the main artifact..." in Android Studio project can be fixed?

查看:252
本文介绍了摇篮德precation"依靠包装来定义主神器的延伸..." Android Studio中的项目可以解决吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习如何使用 Android的工作室是在最好的,但我还是有限的经验尤其是在建设摇篮


  

执行任务:[清洁]


  
  

依靠包装来定义主神器的扩展都有
  被德precated,并计划在摇篮2.0被删除
  :应用:清理-TO-DATE


  
  

BUILD SUCCESSFUL


即使一切正常,我想尽量避免使用的德precated 办法;

我的状态,我看到<一个href=\"http://stackoverflow.com/questions/12934598/what-does-the-message-relying-on-packaging-to-define-the-extension-of-the-main\">this问题并试图了解在Android Studio中去precation消息,但相当现在的工作重点,我是理解的建筑APK以及如何将手中的这个IDE中创建一个项目。

是否有可能通过在项目中不断变化的东西(配置文件或工件)来解决,它?

PS:我在机器人工作室(preVIEW)0.4.3建立133,并在项目中有是二的build.gradle:


  

1)〜/ AndroidStudioProjects / MyAppProject /应用/的build.gradle


 应用插件:'机器人'安卓{
    compileSdkVersion 19
    buildToolsVersion19.0.1    defaultConfig {
        7的minSdkVersion
        targetSdkVersion 19
        版本code 1
        的versionName1.0
    }
    buildTypes {
        发布 {
            runProguard假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard的-rules.txt
        }
    }
}依赖{
    编译com.android.support:appcompat-v7:+
}


  

2)的〜/ AndroidStudioProjects / MyAppProject /的build.gradle


  //顶级构建文件,您可以添加常用的配置选项,所有分项目/模块。buildscript {
    库{
        mavenCentral()
    }
    依赖{
        类路径'com.android.tools.build:gradle:0.8.+
    }
}allprojects {
    库{
        mavenCentral()
    }
}

和一个settings.gradle


  

〜/ AndroidStudioProjects / MyAppProject / settings.gradle


 包括':应用程序


解决方案

这似乎是在Android摇篮插件,而不是一个错误的东西你做错了;我看到它的到来了任何时候,您在您的一个模块的依赖,即使它正确。这个警告是没有什么可担心的。

我提起<一个href=\"https://$c$c.google.com/p/android/issues/detail?id=65501\">https://$c$c.google.com/p/android/issues/detail?id=65501这个问题。

I'd like to learn how to use Android Studio at the best, but I still have limited experience especially in building with 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

Even if everything works I would like to avoid using deprecated methods;

I state that I see this question and tried to understand the deprecation message but fairly the focus for me now is understanding building APK on Android Studio and how to put hands in a project created by this IDE.

Is it possible to fix-it by changing something (configuration files or artifacts) in the project?

PS: I'm on "Android Studio (preview) 0.4.3 build 133" and in the project there is two 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()
    }
}

and one settings.gradle

~/AndroidStudioProjects/MyAppProject/settings.gradle

include ':app'

解决方案

This appears to be a bug in the Android Gradle plugin and not something you're doing wrong; I see it coming up any time you include a dependency in one of your modules even if it's specified correctly. This warning isn't anything to worry about.

I've filed https://code.google.com/p/android/issues/detail?id=65501 about this.

这篇关于摇篮德precation&QUOT;依靠包装来定义主神器的延伸...&QUOT; Android Studio中的项目可以解决吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆