无法设置SDK:Error:Module'app':platform'Google Inc.:Google APIs:21'not found [英] Failed to set up SDK: Error:Module 'app': platform 'Google Inc.:Google APIs:21' not found

查看:1723
本文介绍了无法设置SDK:Error:Module'app':platform'Google Inc.:Google APIs:21'not found的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 无法设置SDK:错误:模块应用程序:找不到平台'Google Inc.:Google API:21'。 

完全丧失了为什么这不起作用。试图更新我的SDK到23,但意识到我没有准备处理所有新的弃用等,所以我恢复到旧版本的Mercurial。我完全没有别的了,而且回归应该已经解决了一切。不幸的是,我无法连接我的应用程序并构建它。我甚至从头重新安装了Android Studio,但我仍然收到相同的警告,我的应用程序根本无法生成。什么可能会出错?



以下是我的构建gradle:

  apply plugin:'com.android.application'

android {
compileSdkVersion'Google Inc.:Google APIs:21'
buildToolsVersion '21 .1.2'

defaultConfig {
applicationIdcom.elgami.customizer
minSdkVersion 14
targetSdkVersion 21
}

buildTypes {
发布{
minifyEnabled false
// runProguard false
// proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.txt'
}
}
}

知识库{
mavenCentral()
maven {urlhttps://jitpack.io}
}

依赖项{
compile'c​​om.ogaclejapan.smarttablayout:library:1.5.0@aar'
compile'c​​om.github.antonyt:InfiniteViewPager:v1.0.0'
compile'c​​om .android.support :appcompat-v7:22.2.0'
// recyclerview
编译'com.android.support:recyclerview-v7:23.1.1'
//谷歌分析
编译' com.google.android.gms:play-services-analytics:8.3.0'
// pager sliding strip
compile'c​​om.astuetz:pagerslidingtabstrip:1.0.1'
// http库(使用beanstream REST)
编译'org.apache.httpcomponents:httpclient-android:4.3.5.1'
// amaazon S3上传
compile'c​​om.amazonaws:aws-android- sdk-s3:2.1。+'
// paypal购买
编译文件('libs / PayPalAndroidSDK-2.7.1.jar')
//模块对ParseLoginUI库资源的依赖性
编译项目(':ParseLoginUI')
//解析libs
编译文件('libs / ParseCrashReporting-1.9.2.jar')
编译文件('libs / Parse-1.9。 1.jar')
编译文件('libs / ParseFacebookUtilsV4-1.9.1.jar')
// android支持v4
编译文件('li bs / android-support-v4.jar')
// facebook SDK
编译'com.facebook.android:facebook-android-sdk:4.1.0'
// butterknife
compile'c​​om.jakewharton:butterknife:6.1.0'
// Subsampling-scale-image-view(用于模板)
//编译'com.davemorrissey.labs:subsampling-scale-image -view:3.1.4'
编译文件('libs / AppRater.jar')
}


<您可以使用 compileSdkVersion 21 来替代您的。

  android {
compileSdkVersion 21
buildToolsVersion '21 .1.2'

defaultConfig {
applicationIdcom.elgami.customizer
minSdkVersion 14
targetSdkVersion 21
}

buildTypes {
release {
minifyEnabled false
// runProguard false
// proguardFiles getDefaultProguardFile ('proguard-android.txt'),'proguard-rules.txt'
}
}
}


Failed to set up SDK: Error:Module 'app': platform 'Google Inc.:Google APIs:21' not found.

At a complete loss as to why this isn't working. Attempted to update my SDK to 23 but realized I wasn't prepared to deal with all the new deprecations, etc., so I reverted to an older version on Mercurial. I've done literally nothing else, and the reversion should have solved everything. Unfortunately, I'm stuck unable to connect my app and build it. I've even reinstalled Android Studio from scratch, but I continue to receive the same warning and my app won't build at all. What could possibly be going wrong?

Here is my build gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:21'
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId "com.elgami.customizer"
        minSdkVersion 14
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            //runProguard false
            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.ogaclejapan.smarttablayout:library:1.5.0@aar'
    compile 'com.github.antonyt:InfiniteViewPager:v1.0.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    // recyclerview
    compile 'com.android.support:recyclerview-v7:23.1.1'
    // google analytics
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    // pager sliding strip
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    // http library (for using beanstream REST)
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    // amaazon S3 uploads
    compile 'com.amazonaws:aws-android-sdk-s3:2.1.+'
    // paypal purchasing
    compile files('libs/PayPalAndroidSDK-2.7.1.jar')
    // Module dependency on ParseLoginUI library sources
    compile project(':ParseLoginUI')
    // Parse libs
    compile files('libs/ParseCrashReporting-1.9.2.jar')
    compile files('libs/Parse-1.9.1.jar')
    compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
    // android support v4
    compile files('libs/android-support-v4.jar')
    // facebook SDK
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    //butterknife
    compile 'com.jakewharton:butterknife:6.1.0'
    // Subsampling-scale-image-view (for templating)
    //compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.4'
    compile files('libs/AppRater.jar')
}

解决方案

You can use compileSdkVersion 21 instead of yours .

    android {
    compileSdkVersion 21
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId "com.elgami.customizer"
        minSdkVersion 14
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            //runProguard false
            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

这篇关于无法设置SDK:Error:Module'app':platform'Google Inc.:Google APIs:21'not found的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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