I am not sure what's the issue. I googled and though it was about matching the sdk versions. They are the same as follows:
build.gradle
android {
compileSdkVersion 17
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 4
targetSdkVersion 17
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':slidingMenu')
compile project(':slidingMenu')
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
compile files('libs/Parse-1.4.0.jar')
}
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gurbani.ujagar"
android:hardwareAccelerated="true"
android:installLocation="preferExternal"
android:versionCode="26"
android:versionName="7.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="17" />
You will be ended up with this error, If your libraries/modules uses different minSdkVersion or targetSdkVersion inside your project.
To find , In which module actual conflicts are happening you can see your Gradle Console output.
Best practice is to have minSdkVersion 8 at least because most of the libraries like play services etc using this.
Please do the following change and sync Project with gradle
Try to Use minsdkVesion 8 in all your build.gradle files as well as AndroidManifest.xml files ans sync.
If it doesn't solves the problem go through your gradle console to and make required changes as per the error shown.
Note : While compilation, your minSdkVersion and targetSdkVersion in AndroidManifest.xml will be overridden by what you have mention in your build.gradle files.
I think slidingMenu library minSdkVersion is greater than yours (minSdkVersion 4). So manifests cant be merged. You cant use library that requires min version 11 (e.g.) in app that works on api version 4.
Related
I'm trying to export my apk but I'm receiving one build error below:
I've added compile 'com.android.support:multidex:1.0.1' in my build.gradle dependencies, enabled multidex in my defaultConfig and also added android:name="android.support.multidex.MultiDexApplication"> within my Android Manifest file but am still receiving the error.
===============================
My build.gradle can be found here:
http://pastie.org/10902207
================================
What is going on? Can anyone give me some insight as to why I am receiving this?
I imagine the issue you are having is because you do not have a minSDK defined in your Build.gradle. The library you are trying to uses minSDKVersion 4.
If you don't specify your minSDKVersion your project is going to automatically default to version 1. Try adding something like the below to your build.gradle file.
android{
compiledSdkVersion 23 //marshmallow
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 11 //honeycomb
targetSdkVersion 23
}
}
I am trying to add a dependency in my app which has the minimum sdk version newer than my apps so I am getting the following error
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library
Suggestion: use tools:overrideLibrary="com.nononsenseapps.filepicker" to force usage
but I don't know where to add that suggestion so I can build it.
This is how my build.gradle(Module: app) looks right now
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.codedspycamera.android"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.nononsenseapps:filepicker:+'
compile 'com.squareup.picasso:picasso:2.4.0'
}
com.nononsenseapps.filepicker works only on >=14 version android device. I think it will crash if you force it to work on <14 devices. But anyway if you want to do this, you should force using minSdkVersion params from your main app to override library value. Add suggested line to main app manifest. Read this for more information.
Just to make the answer more clear for everyone this is what you have to do
tools:overrideLibrary marker
A special marker that can only be used with uses-sdk declaration to override importing a library which minimum SDK version is more recent than that application's minimum SDK version.
Without such a marker, the manifest merger will fail. The marker will allow users to select which libraries can be imported ignoring the minimum SDK version.
Example, In the main android manifest :
<uses-sdk android:targetSdkVersion="14" android:minSdkVersion="2"
tools:overrideLibrary="com.example.lib1, com.example.lib2"/>
will allow the library with the following manifest to be imported without error :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<uses-sdk android:minSdkVersion="4" />
</manifest>
Note that the if multiple libraries are added than they must be separated with a comma ","
For ionic developers
config.xml - add -
<preference name="android-minSdkVersion" value="19" />
bundle.gradle - add
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
So I know that many other people had this problem, but mine is a little different. I've tried running my app on an LG G2 with Android 4.4.4, and a Note 3 with Android 4.4.2, but neither worked. I have installed the API 18, 19, and 20 SDKs.
Failure [INSTALL_FAILED_OLDER_SDK]
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.ween.control"
minSdkVersion 8
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
You can't test an Android-L app on a device with lower API.
Take a look here.
You need to make sure your dependencies are configured targeting the same sdk (also make sure the sdk is supported for the dependency).
As of version .11, the gradle plugin now uses the new manifest merger tool by default which you can use to avoid conflicting configurations when merging manifests from your dependencies while building by specifying <uses-sdk tools:node="replace" /> in your AndroidManifest.xml file.
http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
credit goes to Eddie Ringle
I was having a similar issue but my device sdk was 19 and it was looking for it to be 20. I changed the sdk from the file > Project Structure > SDK to 19 also I noticed when I was running it had the wear value selected in the top toolbar so I switched that to mobile and Voila.
I recently migrated a project into Android Studio 0.4.3.
When compiling, it gave me errors on several lines of java, including the following:
FragmentManager fm = getFragmentManager();
fm.findFragmentById()
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getResources().getStringArray(R.array.course_descriptions);
I see the following error message:
Call requires API level 11 (current min is 7)
I'm running Android Studio .0.4.3. I also downloaded Android 4.4.2 (API 19) through the SDK manager.
I added the following line to my manifest:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
I did a "Sync Project with Gradle files", cleaned and rebuilt the project.
I still see the same errors.
How do I fix this issue ?
I have 0.8.6 version and it's can be done like this:
In the menu: File -> Project Structure.
In the open menu, navigate to app, then in the tabs choose Flavors.
If you have generated your project on recent versions of Android Studio, the setting is in gradle config file. Find build.gradle file in your application module. There should be something like this.
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
Starting from gradle build system all your setting related to sdk and compilation APIs will be overridden by what you define in your build.gradle file.
So going forward if you want you can remove these all configurations from your AndroidManifest.xml and keep them in build.gradle files only to avoid confusions.
So check minSdkVersion in module's build.gradle file which is throwing the error.
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 7 // Change 7 to 11 will solve your problem
targetSdkVersion 19
}
}
I prefer to have these all configurations in my top project level build.gradle file because if the configurations are different in different modules you will be ended up with Manifest Merging error.
In the latest version as of dated 2020, perform the following steps:
Click on Files (top left)
Go to Project Structure (Ctlr + Alt + Shift + S)
Click on modules
In the right pane, click on Default Config (Middle one)
Change Minimum SDK version
Apply and click OK
Done!
Full app/build.gradle minSdkVersion, targetSdkVersion
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.yourapp.package"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
dependencies {
androidTestCompile fileTree(dir: 'libs', include: '*.jar')
androidTestCompile('com.squareup.assertj:assertj-android:1.0.0'){
exclude group: 'com.android.support', module:'support-annotations'
}
}
Simply follow the steps (For android studio users):
right click the App directory
choose the "module setting" option
change the ADK Platform as what you need
Click Apply
That's all buddy, The gradle will rebuild the project automatically.
I got this Froyo (2.2) device that I am using to make an app.
When I try to run the app directly to the device it shows an error saying
pkg: /data/local/tmp/com.example.HelloWorldProject
Failure [INSTALL_FAILED_OLDER_SDK]
and in another window there's an error saying
Unable to attach test reporter to test framework or test framework quit unexpectedly
What seem to make the said errors?
EDIT:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.helloworld"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"/>
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name="com.example.HelloWorldProject.MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
After I changed
defaultConfig {
applicationId "com.example.bocheng.myapplication"
minSdkVersion 15
targetSdkVersion 'L' #change this to 19
versionCode 1
versionName "1.0"
}
in build.gradle file.
it works
This error
Failure [INSTALL_FAILED_OLDER_SDK]
Means that you're trying to install an app that has a higher minSdkVersion specified in its manifest than the device's API level. Change that number to 8 and it should work. I'm not sure about the other error, but it may be related to this one.
Besides checking the right minSdkVersion in build.gradle, make sure you have installed all necessary tools and correct SDK Platform for your preferred Android Version in SDK Manager. In Android Studio klick on Tools -> Android -> SDK Manager. Then install at minimum (for Android 2.2 without emulator):
Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools (latest)
Android 2.2 (API 8)
SDK Platform
Google APIs
This is what worked for me.
Make sure you don't have a minSdkVersion set in your build.gradle with a value higher than 8. If you don't specify it at all, it's supposed to use the value in your AndroidManfiest.xml, which seems to already be properly set.
Just removing uses-sdk tag works for me for such problems.
Failure [INSTALL_FAILED_OLDER_SDK] basically means that the installation has failed due to the target location (AVD/Device) having an older SDK version than the targetSdkVersion specified in your app.
N/B Froyo 2.2 API 8
To fix this simply change
targetSdkVersion="17" to targetSdkVersion="8"
cheers.
Make Sure the Select Run/Debug Configuration is wear or mobile as per your installation in android studio...
Failure [INSTALL_FAILED_OLDER_SDK]
For Sumsung note3 I just edit the AndroidManifest.xml file and add the following code:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"/>
In your manifest file package attribute is set to com.test.helloworld however your activity class is under different package. Change your MyActivity class package to com.example.helloworld
This is because you mobile has older sdk version than your application..!!!
It means your application need sdk version suppose Lollipop but you mobile has version kitkat.
Fix your gradle file the following way
defaultConfig {
applicationId "package.com.app"
minSdkVersion 8 //this should be lower than your device
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
In android studio: reduce minSDKversion. It will work...
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "healthcare.acceliant.trianz.com.myapplication"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
}
I fixed this problem.The device system version is older then the sdk minSdkVersion。
I just modified the minSdkVersion from android_L to 19
to target my nexus 4.4.4.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
**compileSdkVersion 'android-L'** modified to 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.antwei.uiframework.ui"
minSdkVersion 14
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
**compile 'com.android.support:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}
how to modified the value by ide.
select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19
sorry I don't have enough reputation to add pictures
Maybe go to File>Project Structure > Modules and Change your Source Compability to a lower version before Ive done this, Ive changed in build.gradle
mindSdk and tragetSdk from 31 to 30.
Now I can use the Emulator without problems
Change file AndroidManifest.xml
<uses-sdk android:minSdkVersion="19"/>
<uses-sdk android:minSdkVersion="14"/>