我目前正在Android 13 Tiramisu上做一些测试,很难在我的设备上安装这个应用程序。我在Android中安装了Android预览版(Rev.4)。我创建了一个示例应用程序,并将其配置如下
// build.gradle
android {
compileSdkPreview "android-Tiramisu"
defaultConfig {
applicationId "com.example.myapplication"
minSdk 16
targetSdkPreview "Tiramisu"
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
...然后我尝试在我的安卓12 (不是Tiramisu)设备上安装这个应用程序。当我这样做时,我得到了以下错误
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK
List of apks:
[0] '/Users/myuser/dev/sample/MyApplication/app/build/outputs/apk/debug/app-debug.apk'
The application's minSdkVersion is newer than the device API level.在build.gradle中,我指定了minSdk 16,所以应该可以在Android12设备上安装这个应用程序。我该如何解决这个问题?(当targetSdkVersion设置为Tiramisu以外的任何内容时,没有发生此问题)
发布于 2022-06-08 22:18:29
这是预期的工作:在SDK成为最终版本之前,使用Android的预发布版本的目标/编译将只在预发布设备上工作。返回的错误可能更清楚,因为它现在是误导性的。
https://stackoverflow.com/questions/72209350
复制相似问题