码迷,mamicode.com
首页 > 移动开发 > 详细

[Android Studio] 取消引用库打包出现异常-- provided dependencies can only be jars

时间:2017-07-08 11:26:27      阅读:1307      评论:0      收藏:0      [点我收藏+]

标签:==   enabled   com   ble   name   library   targe   app   can   

Warning: Project App: provided dependencies can only be jars. com.android.support:appcompat-v7:22.2.0 is an Android Library
Warning: Project App: provided dependencies can only be jars. com.android.support:support-v4:22.2.0 is an Android Library.

以上是AndroidStudio报的错,


我的build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    provided 'com.android.support:appcompat-v7:22.2.0'
    provided 'com.android.support:support-v4:22.2.0'
}

解决方式:

1.打开项目设置

技术分享


2.改动gradle版本号

技术分享


3.完毕又一次编译一下,祝你成功!



[Android Studio] 取消引用库打包出现异常-- provided dependencies can only be jars

标签:==   enabled   com   ble   name   library   targe   app   can   

原文地址:http://www.cnblogs.com/lytwajue/p/7135932.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!