清单合并失败:uses-sdk:minSDKVersion1不能小于7

时间:2016-08-15 14:33:46

标签: android android-gradle android-manifest

Log

导入BaseGameUtils模块后(对于Google Play游戏服务),我收到了此错误。错误日志说在我的模块清单文件中使用:

<uses-sdk tools:overrideLibrary="android.support.v7.appcompat"/>

然后,当我构建这种情况时:

enter image description here

然后,errorLog建议我将其导入我的Module的清单文件:

<uses-sdk tools:overrideLibrary="android.support.v4"/>

然后,我再次得到第一个错误,这是一个永无休止的来回循环。

App Manifest XML:

  <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tool="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
package="reflexflash.gespanet2015.com.flashreflex">


<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".Arcade1">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

</manifest>

App Gradle:

apply plugin: 'com.android.application'

android {
 compileSdkVersion 24
 buildToolsVersion '24.0.0'

defaultConfig {
    applicationId "reflexflash.gespanet2015.com.flashreflex"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
 buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
    }
 }
}

dependencies {

compile project(':BaseGameUtils')

}

模块清单:

   <?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.example.games.basegameutils"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk tools:overrideLibrary="android.support.v4"/>

<application>
</application>

</manifest>

模块Gradle:

  apply plugin: 'com.android.library'

buildscript {
 repositories {
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.1'
  }
}

dependencies {

// Set defaults so that BaseGameUtils can be used outside of  BasicSamples
if (!project.hasProperty('appcompat_library_version')) {
    ext.appcompat_library_version = '20.0.+'
}
if (!project.hasProperty('support_library_version')) {
    ext.support_library_version = '20.0.+'
}
if (!project.hasProperty('gms_library_version')) {
    ext.gms_library_version = '8.1.0'
}

compile "com.android.support:appcompat-v7:${appcompat_library_version}"
compile "com.android.support:support-v4:${support_library_version}"
compile "com.google.android.gms:play-services-      games:${gms_library_version}"
compile "com.google.android.gms:play-services- plus:${gms_library_version}"
}

android {
// Set defaults so that BaseGameUtils can be used outside of  BasicSamples
if (!project.hasProperty('android_compile_version')) {
    ext.android_compile_version = 23
}
if (!project.hasProperty('android_version')) {
    ext.android_version = '23'
}

compileSdkVersion android_compile_version
buildToolsVersion android_version

1 个答案:

答案 0 :(得分:0)

在模块的清单中,我添加了这一行来修复它:

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

我的minSdkVersion也在我的应用程序的gradle文件中声明。