gpt4 book ai didi

android - list 合并失败 : uses-sdk:minSdkVersion 16 cannot be smaller than version 25 declared in library [Wear App sub-manifest]

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:19:32 24 4
gpt4 key购买 nike

我正在尝试向我现有的 android(最小 sdk 版本 16)应用添加一个可穿戴模块。如果我运行应用程序( Release模式),我会收到此错误:

Error:Execution failed for task ':app:processReleaseManifest'. Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 25 declared in library [Wear App sub-manifest] c:\workspaces\sampleapp\android\app\build\generated\manifests\microapk\release\AndroidManifest.xml Suggestion: use tools:overrideLibrary="" to force usage

我不想增加 minSdkVersion。那么,如何在不更改应用程序的 minSdkVersion 的情况下解决问题?

这是我的 gradle 文件:

手机应用

apply plugin: 'com.android.application'

android {
signingConfigs {
config {
[...]
}
}

compileSdkVersion 25
buildToolsVersion "25.0.2"

repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}
}
defaultConfig {
applicationId "com.sample.app"
minSdkVersion 16
targetSdkVersion 25
signingConfig signingConfigs.config
}
buildTypes {
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
[...]

compile 'com.google.android.gms:play-services-wearable:10.2.0'
wearApp project(':sample-wear')
}

apply plugin: 'com.google.gms.google-services'

可穿戴应用

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

signingConfigs {
config {
[...]
}
}

defaultConfig {
applicationId "com.sample.app"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
signingConfig signingConfigs.config
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.google.android.gms:play-services-wearable:10.2.0'
provided 'com.google.android.wearable:wearable:2.0.0'
}

注意:该错误仅发生在 Gradle 2.3.0 中。 Gradle 2.2.3 按预期工作......

code.google.com 上的类似问题:https://code.google.com/p/android/issues/detail?id=232834

最佳答案

在您的 gradle 文件中,只需将 minSdkVersion 更新为 23

android {
compileSdkVersion 30
defaultConfig {
applicationId "com.oaics.customer"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
}

关于android - list 合并失败 : uses-sdk:minSdkVersion 16 cannot be smaller than version 25 declared in library [Wear App sub-manifest],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42683537/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com