Package id platform: android-O not available

2019-02-17 07:08发布

问题:

While trying to clone Android O sample from github, project can't able to sync and give below error. Android studio give package unavailable, which can't able to install missing platform (android o).

I am using android studio 2.3 and cloning android o example: https://developer.android.com/preview/o-samples.html#nc

Can any one suggest, how can I able to run cloned example?

回答1:

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

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

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

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.