Android P预览中的INSTALL_FAILED_OLDER_SDK

EAK*_*EAM 12 java android android-studio android-gradle-plugin

我正在尝试在我的应用程序中实现更新的android sdk,但它失败了:

INSTALL_FAILED_OLDER_SDK:Failed to parse during installpacageLi at binary xml line 8 : Requires development Platform P but this is a release platform

compileSdkVersion 'android-P'
        defaultConfig {
            applicationId "example"
            minSdkVersion 16
            targetSdkVersion 'P'
            versionCode 223
            versionName '2.2.3-BETA'
            //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            vectorDrawables.useSupportLibrary = true
        }
Run Code Online (Sandbox Code Playgroud)

我试过:清理项目,重建,清理gradle缓存并重新启动......任何想法?

laa*_*lto 19

来自评论:

我正在尝试在我的物理设备上安装,我总是在测试时尝试应用程序.我的设备是API 25,但我现在正在使用SDK API 27测试应用程序并且它运行良好,但它不适用于API P预览,并且不知道为什么

您只能在兼容的预览平台版本设备上安装定位预览平台版本的APK.到目前为止,只有Android P的模拟器图像可用.

targetSdkVersion 'P'在Android P模拟器上测试您的应用.要在其他设备上进行测试,请使用已发布平台的目标SDK版本,例如27.