包ID平台:android-O不可用

时间:2017-03-22 18:33:27

标签: android android-studio android-8.0-oreo

尝试从github克隆Android O示例时,项目无法同步并提供以下错误。 Android工作室提供包不可用,无法安装丢失的平台(android o)。

Android O missing package

我正在使用android studio 2.3并克隆android o示例:https://developer.android.com/preview/o-samples.html#nc

任何人都可以建议,我怎样才能运行克隆示例?

1 个答案:

答案 0 :(得分:8)

To add the Android O items to Android Studio 2.3, I had to temporarily switch to the Canary channel in Android Studio:

Android Studio Channel Settings

Then, in the SDK Manager, I could download the O Developer Preview items:

SDK Manager, Showing O Developer Preview 1

...along with the 26-rc1 build tools, platform tools, and emulator:

SDK Manager, Showing SDK Tools Tab

That should get you past your current problems.

That project is messed up, in that it refers to a @mipmap/ic_launcher that does not exist. You need to get rid of android:icon="@mipmap/ic_launcher" from the <application> element of Application/src/main/AndroidManifest.xml, after which the app appears to work.