Java 应用程序上载到Slideme-未设置有效targetSdkVersion错误
我试图将我的第一个应用程序上载到Slideme,但遇到以下错误: 应用程序必须具有有效的targetSdkVersion集。要解决此问题,您需要编辑AndroidManifest.xml文件并再次上载.apk文件 因此,我将targetSdkVersion添加到清单文件中,并将其从gradle文件中删除,但仍然没有成功。我还用gradle文件中仍然设置的targetSdkVersion再次尝试了它,但也没有成功。我已经玩了很长时间了,但是我总是会犯同样的错误。我多次重置android studio,并尝试关闭和重新打开slideme上载网页,没有任何更改 这是我的manifest.xml文件:Java 应用程序上载到Slideme-未设置有效targetSdkVersion错误,java,android,build.gradle,android-manifest,Java,Android,Build.gradle,Android Manifest,我试图将我的第一个应用程序上载到Slideme,但遇到以下错误: 应用程序必须具有有效的targetSdkVersion集。要解决此问题,您需要编辑AndroidManifest.xml文件并再次上载.apk文件 因此,我将targetSdkVersion添加到清单文件中,并将其从gradle文件中删除,但仍然没有成功。我还用gradle文件中仍然设置的targetSdkVersion再次尝试了它,但也没有成功。我已经玩了很长时间了,但是我总是会犯同样的错误。我多次重置android studi
<?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文件中添加更新的sdk版本:
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.stackoverflowpratice"
minSdkVersion 23
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'
}
这将起作用。将其粘贴到您的清单文件中
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29"/>
如果还有人需要解决这个问题,我在这里回复。 如果您使用的是Unity,请将其他设置中的目标API级别设置为一个特定的API,而不是自动设置
应用程序中是否有多个模块?他们可能有问题你得原谅我的无知,但我不这么认为。。。不过我有两个活动。这是一个超级基本的应用程序。但是,我应该注意,当我将目标值更改为15时,它可以工作,但是当targetSdkValue为29时,我无法让它工作。有什么想法吗?这与我在原始问题中发布的成绩文件有何不同?在你的成绩文件中,你删除了//targetSdkVersion 29,发布apk@JackDuaneI需要它,因为Slideme要求它在清单文件中。这就是我在原问题中所说的。
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29"/>