无法将应用程序安装到用targetsdkversion指定的设备:tiramisu- android

发布于 2025-01-28 00:13:56 字数 1009 浏览 2 评论 0原文

我目前正在对Android 13 Tiramisu进行一些测试,并且很难在设备上安装该应用程序。 我已经在Android Studio中安装了Android Tiramisu Preview(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"
    }
    ...

然后尝试将此应用程序安装在我的 Android 12 (不是Tiramisu)设备上。 当我这样做时,我在build.gradle中得到以下错误

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.

,我已经指定了minsdk 16,因此应该可以在Android 12设备上安装该应用程序。 我该如何解决这个问题? (当TargetsDkversion设置为Tiramisu以外的任何事物时,没有发生此问题)

I am currently doing some testing on Android 13 Tiramisu and am having trouble getting the app to install on my device.
I have installed Android Tiramisu Preview (Rev.4) in Android Studio.
I created a sample app and configured it as follows

// 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"
    }
    ...

I then tried to install this app on my Android 12 (not Tiramisu) device.
When I did so, I got the following error

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.

In build.gradle, I have specified minSdk 16, so it should be possible to install the app on an Android 12 device.
How can I solve this problem?
(This problem did not occur when targetSdkVersion was set to anything other than Tiramisu)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

死开点丶别碍眼 2025-02-04 00:13:56

这是按预期工作的:使用Android的预释放版本的定位 /编译仅在SDK最终之前使用预发行设备。返回的错误可能更清晰,因为它现在误导了。

This is working as intended: targeting / compile with a pre-release version of Android will only work on pre-release device, before SDK is final. The error returned could be clearer, as it is misleading right now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文