为什么 Android R SDK 在 Marshmallow 中不起作用?

普贾·辛格

我将我的 SDK 版本更新为最新的 API 级别 30 (R),即所谓的 Android 11。现在,它在 Android R 模拟器中完美运行,但是当我尝试在棉花糖版本上运行时,它给出了以下异常。我试图删除所有 SDK 和清理/重建项目,使缓存/重启无效。

  **Exception:**
    Installation did not succeed.
    The application could not be installed: INSTALL_FAILED_OLDER_SDK
    The application's minSdkVersion is newer than the device API level.

它只适用于 Android R。我该怎么办?

android {
    compileSdkVersion 'android-R'
    defaultConfig {
        applicationId "com.lifetrenz.lifetrenz_gcc_doctorapp"
        minSdkVersion 21
        targetSdkVersion 'R'
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

我想测试从 API 21 到 API R 的应用程序

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Lifecycle components
    def life_versions = "2.2.0-beta01"

    implementation "android.arch.lifecycle:extensions:$life_versions"
    annotationProcessor "android.arch.lifecycle:compiler:$life_versions"

    //Server API Integration
    implementation 'com.squareup.retrofit2:retrofit:2.7.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
    implementation "com.squareup.okhttp3:logging-interceptor:4.4.0"
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'

    //For QR Scanner
    implementation 'com.google.android.gms:play-services-vision:19.0.0'
}
尼科斯·伊达尔戈

根据开发者预览网站

Android 11 开发者预览版适用于 Google Pixel 4 / 4XL、Pixel 3a / 3a XL、Pixel 3 / 3 XL 和 Pixel 2 / 2 XL。

就目前而言,您只能在上述物理设备上运行和测试针对 R 的应用程序以及在 R 上运行的最新 Android Studio 模拟器。似乎当 Studio 进行 Gradle 构建和清单合并时,构建工具会自动更改您的minSdk 到 R。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Android Studio - 为什么 requireViewById(R.id.recyclerview) 在 API 22 中不起作用(它在 28 中)

为什么我在Android中的按钮不起作用?

为什么minHeight属性在WebView Android中不起作用?

为什么if(value ==“ imperial”)在Android中不起作用?

为什么这不起作用?Android中的空指针

为什么R的gsubfn中的\\ b对我不起作用?

为什么此Regex在R中不起作用

为什么变异函数在R中不起作用?

为什么R中的这个图例不起作用?

为什么 HorizontalScrollView 不起作用(Android)?

AppInviteDialog在Android Facebook SDK 4.0中不起作用

在R中,为什么<-也是赋值,为什么rm(list <-ls())不起作用?

为什么Photoshop SDK示例代码在我的Mac-OS10.7中不起作用?

Android Marshmallow 中的 NotificationListenerService

为什么R中的箭头分配在转换函数调用中不起作用?

为什么method ='curl'在R中的download.file中不起作用?

为什么 c() 在 R 中的这个递归函数中不起作用?

为什么三星android设备中的旋转不起作用?

为什么“ System.out.println”在Android中不起作用?

为什么mToolbar和Toolbar在Android Studio中不起作用

为什么Android BaseAdapter Click侦听器在PullToRefreshListView中不起作用?

为什么官方文档中的Android Instrumented Test示例不起作用?

请告诉我,为什么滚动视图在android studio中不起作用?

我不知道为什么这个 FFmpeg 命令在 android 中不起作用?

为什么我的歌曲在我的 android 应用程序中不起作用?

为什么我在Kotlin中的按钮不起作用?(Android Studio)

为什么有些照片在我的android应用程序中不起作用

为什么“新文件(路径)”在Android 6.0中不起作用

为什么where子句查询在android的sqlite数据库中不起作用?