Android应用程序Azure依赖项gradle生成错误 [英] Error on Android app Azure dependency gradle build

查看:101
本文介绍了Android应用程序Azure依赖项gradle生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Gradle同步时在Android Studio 2.3.3上收到以下错误:

I am getting the following error on Android Studio 2.3.3 at Gradle sync.:

错误:模块'com.microsoft.azure:azure-mobile-android:3.3.0'取决于一个或多个Android库,但是是一个jar."

"`Error:Module 'com.microsoft.azure:azure-mobile-android:3.3.0' depends on one or more Android Libraries but is a jar."

如果我使用

compile 'com.microsoft.azure:azure-mobile-android:3.1.0'

代替

compile 'com.microsoft.azure:azure-mobile-android:3.3.0'

但是我不想使用过时的版本.

but i don't want to use an outdated version.

build.gradle文件是:

build.gradle file is:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "com.my_software.myapp"
        minSdkVersion 14
        targetSdkVersion 25
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }
}
dependencies {
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.google.android.gms:play-services-drive:11.0.1'
    compile 'com.google.android.gms:play-services-plus:11.0.1'
    //FOR microsoft Azure
    compile 'com.microsoft.azure:azure-mobile-android:3.3.0'
}

临时解决方案:

compile('com.microsoft.azure:azure-mobile-android:3.3.0@aar'‌​)

(在末尾添加@aar).

(add @aar at the end).

推荐答案

我查看了build.gradle/3.1.0/sdk/src/sdk/build.gradle"rel =" nofollow noreferrer> 3.1.0

I reviewed the source code of azure-mobile-apps-android-client on GitHub, and the difference of the build.gradle between 3.1.0 and 3.3.0 is that the version 3.3.0 required the dependency com.android.support:customtabs:23.0.1, but version 3.1.0 not. So you need to downgrade the compileSdkVersion & targetSdkVersion value from 25 to 23 to support the required Android library to resolve it, due to com.android.support:customtabs:23.0.1 is belong to Android API 23.

这篇关于Android应用程序Azure依赖项gradle生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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