为什么 AndroidManifest.xml 有无效的 targetSdkVersion?

Why does AndroidManifest.xml have invalid targetSdkVersion?

我使用 android studio 3 构建了一个应用程序,但是当我想发布它时,市场说 "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." 我认为 proguard 会造成这个问题,所以将 -keep AndroidManifest.xml 添加到规则中。但这并不能解决我的问题。 请问你能帮帮我吗? 我忘了说我的清单中没有 targetSdkVersion。我手动添加了它,但没有解决我的问题。 我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ir.farshidete.breathefree">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /><!--optional-->
    <uses-permission android:name="android.permission.VIBRATE" /><!--optional-->

    <application 
        android:name=".G"
        android:allowBackup="true"
        android:icon="@drawable/icon128"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/AppTheme">
        <activity android:name=".Main_Activity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Relaxing_Activity" />
        <activity android:name=".Setting_Activity" />
        <activity android:name=".Info_Activity" />
        <activity android:name=".Absorption_Activity" />
        <activity android:name=".Capacity_Activity" />
        <activity android:name=".Control_Activity" />
        <activity android:name=".Program_Activity" />
        <activity android:name=".Contact_Activity" />
        <activity android:name="ir.tapsell.sdk.TapsellAdActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" >
        </activity>
    </application>
</manifest>

我的gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "ir.farshidete.breathefree"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        debug {
            minifyEnabled false
            // Uses new built-in shrinker http://tools.android.com/tech-docs/new-build-system/built-in-shrinker
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro'
        }

        release {
            minifyEnabled false
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro'
        }
    }
}

dependencies {
    api(name:'tapsell-sdk-android', ext:'aar')
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

最后我通过以下方式解决了这个问题: 删除:

minSdkVersion 15
targetSdkVersion 28

来自 gradle。 并添加:

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="26" />

显化! 似乎 slideme.org 不是最新的...