1

我的皮棉失败:

 The SDK platform-tools version (26.0.2) is too old to check APIs compiled with API 27; please update

但据我所知 26.0.2 仍然是最新的平台工具:

⋊> ~ sdkmanager --list | grep platform | grep tools                                                                14:32:26
Warning: Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-19-1' (Expected '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-19')
Warning: Observed package id 'add-ons;addon-google_apis-google-10' in inconsistent location '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google_inc_-10' (Expected '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-10')
Warning: Observed package id 'extras;android;m2repository' in inconsistent location '/home/ligi/bin/android-sdk/temp/ExtraPackage.old01' (Expected '/home/ligi/bin/android-sdk/extras/android/m2repository')
Warning: Already observed package id 'extras;android;m2repository' in '/home/ligi/bin/android-sdk/extras/android/m2repository'. Skipping duplicate at '/home/ligi/bin/android-sdk/temp/ExtraPackage.old01'
Warning: Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-19-1' (Expected '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-19')
Warning: Observed package id 'add-ons;addon-google_apis-google-10' in inconsistent location '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google_inc_-10' (Expected '/home/ligi/bin/android-sdk/add-ons/addon-google_apis-google-10')
Warning: Observed package id 'extras;android;m2repository' in inconsistent location '/home/ligi/bin/android-sdk/temp/ExtraPackage.old01' (Expected '/home/ligi/bin/android-sdk/extras/android/m2repository')
Warning: Already observed package id 'extras;android;m2repository' in '/home/ligi/bin/android-sdk/extras/android/m2repository'. Skipping duplicate at '/home/ligi/bin/android-sdk/temp/ExtraPackage.old01'
Warning: Errors during XML parse:
Warning: javax.xml.bind.UnmarshalException
 - with linked exception:
[java.net.MalformedURLException]
Warning: Additionally, the fallback loader failed to parse the XML.
  platform-tools                                                                           | 26.0.2  | Android SDK Platform-Tools                          | platform-tools/                                                                          
  platform-tools                                                                           | 26.0.2       | Android SDK Platform-Tools                                          
4

2 回答 2

3

您可能需要将 gradle 类路径更新为classpath 'com.android.tools.build:gradle:3.0.0',并将 gradle 包装器更新为distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

于 2017-11-21T07:33:53.597 回答
1

我遇到了同样的问题。我将 Android Gradle 插件版本从 2.3.3 更改为 3.0.1,并且它可以正常工作(不再出现 lint 错误)。在示例 GitHub 项目中,它有 2.3.3 导致相同的错误。注释该行并取消注释第 10 行。 更改

查看更多详细信息:https ://issuetracker.google.com/issues/69573867#comment3 https://github.com/saurabhkpatel/SampleAndroidProject27

于 2017-11-21T20:11:54.993 回答