How should I use tools:overrideLibrary? - android

So this error message appears:
What went wrong:
Execution failed for task ':cloud_firestore:processDebugAndroidTestManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.google.firebase:firebase-firestore:24.1.2] C:\Users\DELL.gradle\caches\transforms-3\2bfce4225340219067212fe3be9c89b6\transformed\jetified-firebase-firestore-24.1.2\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.google.firebase.firestore" to force usage (may lead to runtime failures)
I keep getting the same error eventho I applied the suggested changes. Another problem is that it doesn't save the changes. After applying the changes, I get the same error. Upon checking I see the same code before the change, as if it doesn't save the changes(Yes, I have saved the changes).
The build.gradle file:
minSdkVersion 23
targetSdkVersion 32
The Android.Manifest.xml file:
<?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.firebase.firestore"
android:versionName="24.1.2" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="29" />
Like I said, I've applied the following changes: change minSdkVersion to 23, change targetSdkVersion to 32 and addes the tools:overrideLibrary line. But I keep getting the same error as thou nothing has changed. It goes back to this default code as shown above. Any help with this will be appreciated.

Related

android.support.customtabs error after updating to android studio 2.0

Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library [com.android.support:customtabs:23.2.1] 2/app/build/intermediates/exploded-aar/com.android.support/customtabs/23.2.1/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.customtabs" to force usage
why this coming ?
this coming after updating to andorid studio 2.0
add <uses-sdk tools:overrideLibrary="android.support.customtabs"/> to your manifest,
And also include
xmlns:tools="http://schemas.android.com/tools" in root of your manifest file
like
If you already have that tag tool:overrideLibrary="example library" and you need to use that for more than one, just separe with "," as this example:
<uses-sdk tools:overrideLibrary="com.example.lib1, com.example.lib2"/>

Where to change minSdkVersion setting in PhoneGap app

I'm having a strange issue when trying to build a basic PhoneGap app on OS X. The app is setup with just the Android platform. I'm getting the following error when I enter "PhoneGap build".
:processDebugManifest
/Volumes/Data/Tests/my-app/platforms/android/AndroidManifest.xml:15:5 Error:
uses-sdk:minSdkVersion 7 cannot be smaller than version 10 declared in library /Volumes/Data/Tests/my-app/platforms/android/build/intermediates/exploded-aar/android/CordovaLib/unspecified/debug/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usage
When I then edit the indicated file and set the line to
<uses-sdk android:minSdkVersion=“10” android:targetSdkVersion="22" />
and build again, the error doesn't change. Does this setting exist somewhere else? Or is there something else going on here?
The AndroidManifest.xml file is overwritten during the build process by the values from config.xml. You should define this properties in the config.xml file.
Reference:
http://docs.build.phonegap.com/en_US/3.3.0/configuring_preferences.md.html#Preferences
<preference name="android-minSdkVersion" value="10" />

minSdkVersion correctly defined in manifest still getting errors

In my Android Manifest I have these value set:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
But I keep getting errors like this:
Error:(7, 5) uses-sdk:minSdkVersion 9 cannot be smaller than version 10 declared in library …app\build\intermediates\exploded-aar\com.facebook.android\facebook\3.21.1\AndroidManifest.xml
Or at another place where I using this code:
newFragment.show(getFragmentManager(), "datePicker");
I get warning with red line that however when i run it runs fine:
`Call requires min API level 11 (current min is 9…`
Why is that when I have set minSdkVersion to way above than required?
If you are using Gradle, the minSdkVersion declared in your build.gradle file takes precedence over what is declared in your AndroidManifest.xml - in fact, you can remove those lines from your manifest entirely.
The minSdk errors that you are getting is because of the libraries included and not because of your app. For example facebook requires minSdk 9 which is declared in its manifest

Could not find element /manifest/application in play-services\4.0.30\AndroidManifest.xml

I am updating project in AndroidStudio, used target API 20 instead of 19. During this process I encounter this error:
[PathToMyProject]\myproject\build\exploded-aar\com.google.android.gms\play-services\4.0.30\AndroidManifest.xml:
Error:(1) Could not find element /manifest/application. //showing
several times
This is the file AndroidManifest.xml where is the error:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="4030530"
android:versionName="4.0.30 (889083-30)" >
<uses-sdk android:minSdkVersion="8"/>
</manifest>
When I add <application/> tag and run Make or Rebuild, the manifest is for an unknown reason refreshed and does not contain added <application> tag and the error shows again...
I had the same problem.
You need to change the build.gradle to get the gms version for wearables.
So, add compile 'com.google.android.gms:play-services-wearable:+' to dependencies, and it should work.

Android SDK Check Not Working

I am trying to change the transition from default to sliding in. I would like to keep my minSdkVersion to be 3 however overridePendingTransition wasn't added until API level 5 (Android 2.0).
I tried creating an integer to represent the SDK version and then only override the transition when in Android 1.6 or less via a simple if statement.
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
if(sdkVersion>=5)
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.fade_out);
Eclipse gives me a LINT warning stating "Call requires API level 5 (current min is 3): android.app.Activity#overridePendingTransition"
If I suppress this error and run it anyway it crashes on Android 1.6 or lower.
What is wrong with my code and how can I fix it? Any suggestions would be very appreciated!
In your android manifest file you have this ...
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="latest version" />
Change the min sdk version to 5 like show below
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="latest version" />

Categories

Resources