【问题标题】:Android API 26 Platform not found, package not available for download未找到 Android API 26 平台,无法下载软件包
【发布时间】:2017-08-06 01:17:44
【问题描述】:

这发生在我升级我的 android studio 之后。我已经在堆栈溢出和其他一些晦涩的论坛上尝试了所有类似的答案,但我没有得到这个错误的任何地方,而且我已经解决了 6 个小时。我也一直在使用 sdk 工具管理器,但我没有得到任何结果。哦,那 maven 的东西是新的,从类似的答案中尝试过。

这是我的 gradle 文件:

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.loredylore.lorebuilder"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    compile 'com.android.support:support-vector-drawable:26.0.0-alpha1'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    compile 'com.google.firebase:firebase-auth:11.0.2'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'
    compile 'com.google.firebase:firebase-crash:11.0.2'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    compile 'com.android.support:support-annotations:26.0.0-alpha1'
    //new
    testCompile 'junit:junit:4.12'

}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

  • 您发布的图片无法阅读。如果您执行文件-> 新项目,会发生这种情况吗?如果您逐个添加依赖项怎么办?您是否尝试过干净重建?您安装的“最新”的 android studio 是什么?你有平台 26 的 SDK 文件吗?你是否删除/重新下载了所有的 SDK(以防万一它坏了?)我的意思是,很难知道发生了什么。用 API 25 试试,你有同样的问题吗?
  • 不惜一切代价避免文件新项目,重新配置太多。不过,它是 Platform 26 的第 2 版。我确实有 sdk 文件,在新目录中再次下载并安装了 android studio 和 sdk,并更改了新 sdk 目录的路径,但出现了相同的行为/错误。我现在正在尝试 API 25 路由,但现在我必须修复一堆新的依赖问题。干净重建是我尝试的第一件事。不知道为什么图像这么小,但如果你滚动它并按住控制按钮,那么如果你在 Windows 上它应该是可见/清晰的。
  • 您至少可以裁剪图像以使其成为可见尺寸。更好的选择是将信息复制/粘贴为文本。
  • 没有给我调整图像大小的图像,因为我没有足够的代表,也不是真正可以复制和粘贴的东西。

标签: android android-studio build.gradle


【解决方案1】:

使用版本 25.0.3,如果您必须从版本 26 android 向后迁移到 25,您可能需要将一些视图重新转换为文本视图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多