我的应用未在高于棉花糖的操作系统版本上运行

时间:2018-09-27 10:14:48

标签: java android

我开发了拉链锁屏应用程序。该应用程序低于Android 6.0版,但不高于6.0版..但是我希望该应用程序在所有Android版本中均可..如果可以,那么如何? plzzzzzz帮帮我..

我已经发布了清单代码和gradle.build应用程序文件的代码。 如果您需要任何文件的代码,请告诉我。 我将在此处发布代码。 提前谢谢你。.

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

    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.PHONE_STATE_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar">
        <activity
            android:name="com.valentines.zipperlock.SettingActivity"
            android:excludeFromRecents="true"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"></activity>
        <activity
            android:name="com.valentines.zipperlock.LockscreenActivity"
            android:excludeFromRecents="true"
            android:screenOrientation="portrait"/>

        <service android:name="com.valentines.zipperlock.service.LockscreenService" />
        <service android:name="com.valentines.zipperlock.service.LockscreenViewService" />

        <activity
            android:name="com.valentines.zipperlock.Developerintro"
            android:excludeFromRecents="true"
            android:label="@string/title_activity_developerintro"
            android:screenOrientation="portrait"
            android:parentActivityName="com.valentines.zipperlock.SettingActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.valentines.zipperlock.SettingActivity" />
        </activity>
        <activity
            android:name="com.valentines.zipperlock.Splash"
            android:excludeFromRecents="true"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
    </application>

</manifest>



apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "com.valentines.zipperlock"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 3
        versionName "1.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
}

2 个答案:

答案 0 :(得分:-1)

您必须升级compileSdkVersion。使用compileSdkVersion 22,您可以在API 22设备上运行该应用程序。 API 22对应于Android 5.1。

答案 1 :(得分:-1)

更新您的渐变文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26'

    defaultConfig {
        applicationId "com.valentines.zipperlock"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 3
        versionName "1.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
}

有关sdk版本的更多详细信息,请检查以下内容: