java - 应用上传到 Slideme - 有效的 targetSdkVersion 未设置错误
问题描述
我正在尝试将我的第一个应用程序上传到 Slideme 并遇到以下错误:您的应用程序必须具有有效的 targetSdkVersion 集。要解决此问题,您需要编辑 AndroidManifest.xml 文件并再次上传 .apk 文件。
所以我将 targetSdkVersion 添加到我的清单文件中,并将其从我的 gradle 文件中删除,但仍然没有运气。我还尝试了仍然在 gradle 文件中设置的 targetSdkVersion 但也没有运气。我玩了很多,但我一直收到同样的错误。我已经多次重置 android studio,并且尝试关闭并重新打开 slideme 上传网页而没有任何变化。
这是我的 manifest.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.doublerun">
<uses-sdk android:targetSdkVersion="29" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".GameActivity"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这是我的 Gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.cards.doublerun"
minSdkVersion 15
//targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
我看过这个问题:为什么 AndroidManifest.xml 有无效的 targetSdkVersion? 和这个问题:Valid sdkVersion for slideme.org 但两者中提供的建议对我不起作用。任何帮助将不胜感激。
解决方案
将此粘贴到您的清单文件中
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29"/>
推荐阅读
- c - 这种 1 位单色 B&W bmp 图像的二进制表示有什么问题?
- terraform - Vault - 为一个身份组分配多个别名
- sql - 选择嵌套 json 数组字段包含 PostgreSQL 中提供的数组中的任何值的行?
- python - 从多个网络链接中抓取表格
- jpa - 在(Collection )方法中使用 JPA 规范时没有返回结果
- javascript - addEventListener 不转发参数
- c# - 通过脚本为 Light2D 设置动画
- extjs - ExtJs 7.3 MODERN 中的状态网格
- python - ValueError:缺少提供给“parse_dates”的列:“CRASH_DATE,CRASH_TIME”
- reactjs - 如何同时运行 Reactjs 和 Spring Boot 应用程序?