0

I am trying to upload my first app to Slideme and am running into the following error: Your application must have a valid targetSdkVersion set. To solve this problem, you need to edit your AndroidManifest.xml file and upload again the .apk file.

So I added targetSdkVersion to my manifest file and removed it from my gradle file and still no luck. I also tried it again with the targetSdkVersion still set in the gradle file but also no luck. I've played around quite a but but I keep getting the same error. I've reset android studio multiple times and I've tried closing and re-opening the slideme upload web page with no change.

Here is my manifest.xml file:

    <?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>

And here is my Gradle file:

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'
}

I've looked at this question: Why does AndroidManifest.xml have invalid targetSdkVersion? and this question: Valid sdkVersion for slideme.org but the advice that is provided in both isn't working for me. Any help would be greatly appreciated.

MohanKumar
  • 960
  • 10
  • 26
Jack Duane
  • 185
  • 3
  • 17
  • do you have multiple modules inside the app? there might be a problem with them – h_malik Sep 28 '19 at 16:31
  • You'll have to pardon my ignorance but I don't think so... I do have two activities though.This is a super basic app. I should note however, that I got it to work when I changed the target value to 15 but that I can't get it to work with a targetSdkValue of 29. Any thoughts? – Jack Duane Sep 28 '19 at 17:25

3 Answers3

0

have you tryied by adding updated sdk version in Gradle file:

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'
}

this will work.

YuvrajsinhJadeja
  • 1,383
  • 7
  • 23
0

Paste this into your manifest file

<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29"/>
0

I replied here if anyone still need to solve this issue. If you are using Unity, set Target API Level in Other Setting to one specific API instead of Automatic enter image description here

Thanh
  • 1
  • 2