Android, Is it possible to use on old release version of Google Admobs dependency release? - android

When I try to create Google Admob banner on my project, I receive an error like this below. I want to ask that, is there a solution without changing the minSDKVersion from 14 to 17? Maybe using an old release version of google ads dependency implementation on build.gradle file? If yes, is there any drawback doing this?
Thanks..
Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [com.google.android.gms:play-services-ads:19.1.0] C:\Users\SAMSUNG\.gradle\caches\transforms-2\files-2.1\3f183cf0518755adc969c4fb4eee168a\jetified-play-services-ads-19.1.0\AndroidManifest.xml as the library might be using APIs not available in 14
Suggestion: use a compatible library with a minSdk of at most 14,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.android.gms.ads.impl" to force usage (may lead to runtime failures)

Related

Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library

I am using instamojo payment library in my project version 3.4.0
compile 'com.instamojo:android-sdk:3.4.0'
when i change min Sdk version from 21 to 19, it is showing me following error
things i have done
change minSdkVersion 19 (in build.gradle app),
then sync,
then sync all project gradle files,
rebuilt project
invalid caches and restart
Any help will be valuable
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.instamojo:android-sdk:3.4.0] C:\Users\Rushabh.gradle\caches\transforms-2\files-2.1\811256b860a0ca6a3de017f237334983\jetified-android-sdk-3.4.0\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.instamojo.android" to force usage (may lead to runtime failures)
as per the error the library is to minSDK 21 , so you have to use that as minSDK ,as for the particular librays docs please go through in detail , as per build file from github it can be seen minSDK is set as 21.
see here in github of this build file from the library
This is confusing because there are 2 places where you can set the MinSDK. You can set it in the build.gradle file. (which is probably where you looking) and then also you forgot that it is set in "projects structure" screen. Go to the left in android studio and right click on your project and go down to "open module settings F4" in that screen under modules you can set the MinSDK. Make sure that and your build.gradle are the same.
Thank you #0ldMaid! Once I added the same version in both file paths the error went away.
uses-sdk android:minSdkVersion="21"
C:\Users\YourName\source\repos\MauiApp1\Platforms\Android\AndroidManifest.xml
C:\Users\YourName\source\repos\MauiApp1\obj\Debug\net6.0-android\AndroidManifest.xml

i got this error while i builde my project

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller
than version 16 declared in library
[com.google.firebase:firebase-iid:20.0.2]
C:\Users\bushi.gradle\caches\transforms-2\files-2.1\946a39d7756c6b05aa38a853bdffc128\firebase-iid-20.0.2\AndroidManifest.xml
as the library might be using APIs not available in 15 Suggestion:
use a compatible library with a minSdk of at most 15, or increase
this project's minSdk version to at least 16, or use
tools:overrideLibrary="com.google.firebase.iid" to force usage (may
lead to runtime failures)
Change minSdkVersion 15 in your build.gradle file to minSdkVersion 16.
The libraries you are referencing require a later version of Android.
You can find the build.gradle file under Gradle Scripts in Android Studio. The change you want to make is in the (Module: app) build file.

Androidx min sdk

What is androidx min sdk? I just migrated to androidx and i need to support minsdk 14. But my build fails indicating that androidx.browser:browser:1.0.0 has minsdk 15.
I can't find it in release notes or anywhere else
androidx.browser:browser:1.0.0 requires the minSdk = 15 (see) in order to function properly, so generally theres no way to support minSdk = 14 while still using androidx.browser:browser:1.0.0.
So basically you have these options:
a. Set minSdkVersion to 15 in app level build.gradle file(and stop supporting minSdkVersion 14)
However if u 'must' have to support minSdkVersion 14 :
b. You can add this line in AndroidManifest.xml file just before application tag:
<uses-sdk tools:overrideLibrary="androidx.browser"/>
this will ensure the project will run properly in most cases but it might lead to run time crashes in few occasions.If you are not really using some feature of the class that absolutely requires sdkVersion 15 then u might just get lucky.
c. Look for alternative classes that can do similar behaviour with minSdkVersion 14 (this might be extremely unlikely)
d. You can consider reverting back to android support libraries instead of androidx. Since, android support libraries will continue to stay around in the google's maven repo for a while.
As stated here:
Starting with Support Library release 26.0.0 (July 2017), the minimum supported API level across most support libraries has increased to Android 4.0 (API level 14) for most library packages.
AndroidX has started with the support library for API Level 28, so minSdk 14 will be the requirement.
For your artifact, the current stable version requires minSdk 15 and the current latest alpha release (1.2.0-alpha09) requires minSdk 16.
AndroidX browser is afaik a replacement / androidX version of Chrome Custom Tabs which had required minSdk 16, maybe this explains the sdk requirement.
By the way you can find the release notes here.

how to use obsolete android sdk versions

I have a Motorola Devour phone, which is quite old, and runs android 1.6. I have been trying to write my own apps for it, but I can't run the gradle sync because my minSdkVersion is 4. It comes out with this error:
Manifest merger failed : uses-sdk:minSdkVersion 4 cannot be smaller than version 14 declared in library [com.android.support:animated-vector-drawable:28.0.0] C:\Users\mccra\.gradle\caches\transforms-1\files-1.1\animated-vector-drawable-28.0.0.aar\19bf506067f85ca5d48da2fd39d59695\AndroidManifest.xml as the library might be using APIs not available in 4
Suggestion: use a compatible library with a minSdk of at most 4,
or increase this project's minSdk version to at least 14,
or use tools:overrideLibrary="android.support.graphics.drawable" to force usage (may lead to runtime failures)
I included the tools:overrideLibrary in the android manifest as
<uses-sdk tools:overrideLibrary="android.support.v7.appcompat, android.support.fragment, android.support.graphics.drawable, android.support.coreui, android.support.coreutils, android.support.loader, android.support.v7.viewpager, android.support.coordinatorlayout, android.support.drawerlayout, android.support.slidingpanelayout, android.support.customview, android.support.swiperefreshlayout, android.support.asynclayoutinflater, android.support.compat, androidx.versionedparcelable, android.support.cursoradapter, android.arch.lifecycle, android.support.documentfile, android.support.localbroadcastmanager, android.support.print, android.arch.lifecycle.viewmodel, android.arch.lifecycle.livedata, android.arch.lifecycle.livedata.core, android.arch.core, android.support.interpolator"/>
as it gave an error for every single api. When I run the gradle sync, I keep getting the same errors as before I overrode them. Then I tried to change the minSdkVersion on each library, but there must be a better way to do this.
Again, I am trying to make this app run on Doughnut, which is android 1.6, and API 4.
You need to get rid of all of those dependencies, as none of them will work on Android 1.6.

what is the new version of styleabletoast

Manifest merger failed :
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.muddzdev:styleabletoast:2.1.2] C:\Users\java\.gradle\caches\transforms-1\files-1.1\styleabletoast-2.1.2.aar\9c4fc146927a85bf2fdc6fca1c3fb32a\AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.muddzdev.styleabletoastlibrary" to force usage (may lead to runtime failures)
Suggestion: use a compatible library with a minSdk of at most 15
It's pretty clear what you should do.
Library supports minsdk >= 16 only so, change your minsdk to upper than 16 or equal.
Also, if you're looking for new version of a library, search the library name and version like this: com.muddzdev:styleabletoast:2.1.2 then you'll see results which includes library's github page and maybe more. So, they should be providing the latest versions on their github page but if you still couldn't see it, look for where the author of library uploaded. for e.x: maven, jcenter or whatever then you'll be able to see the latest version on the library's page.
You can find all available versions here:
https://mvnrepository.com/artifact/com.muddzdev/styleabletoast

Categories

Resources