[英]Eclipse project move to Android Studio. There is error in minsdk version
I imported my project from Eclipse
to to Android Studio
. 我将项目从
Eclipse
导入to Android Studio
。 When I built project I take error message below: 构建项目时,出现以下错误消息:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library [com.google.android.gms:play-services:11.0.0] C:\Users\Ahmet\Documents\edx\Android\WonderkidandTransfersforFM17\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\11.0.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.google.android.gms.play_services" to force usage
I tried change minsdk version and I tried add tools:overrideLibrary="com.google.android.gms.play_services"
in manifest. 我尝试更改minsdk版本,并尝试在清单中添加
tools:overrideLibrary="com.google.android.gms.play_services"
。 I can't solve this problem. 我不能解决这个问题。
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ahmety.wonderkidandtransfersforfm17"
android:versionCode="24"
android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.ahmety.wonderkidandtransfersforfm17"
minSdkVersion 10
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/OneSignalSDK.jar')
}
You do not need a Jar file for OneSignal. 您不需要OneSignal的Jar文件。
compile 'com.onesignal:OneSignal:3.5.7'
And never use a +
as a version or compile all the Google Play Services 绝不要使用
+
作为版本或编译所有的Google Play服务
compile 'com.google.android.gms:play-services:+'
Please choose only those that you actually need. 请仅选择您实际需要的那些。
https://developers.google.com/android/guides/setup#split https://developers.google.com/android/guides/setup#split
For example, 例如,
compile 'com.google.android.gms:play-services-ads:11.0.0'
Regarding the error, you need to change android:minSdkVersion="10"
to be version 14, as it says. 关于错误,您需要将
android:minSdkVersion="10"
更改为版本14,如其所说。
You need to change the "minSdkVersion" from 10 to 14 in both "manifest" and "build.gradle". 您需要将“清单”和“ build.gradle”中的“ minSdkVersion”从10更改为14。 Otherwise you need to downgrade the version of "Google Play Services" library, I won't recommend that.
否则,您需要降级“ Google Play服务”库的版本,我不建议您这样做。 I'll suggest you to just change the "minSdkVersion" from 10 to 14. I won't make difference to your app because I don't think people are still using Android devices of version 10.
我建议您将“ minSdkVersion”从10更改为14。我不会对您的应用有所影响,因为我认为人们仍不会使用版本10的Android设备。
Sync your project after changing the "minSdkVersion". 更改“ minSdkVersion”后,同步项目。
您使用的库要求清单中的minSdkVersion
至少为14。您需要将minSdkVersion
设置为14或更大。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.