how to use obsolete android sdk versions - android

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.

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

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

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)

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

Can I use Widgets from support library of Android L Preview in current Android Version?

I am trying to use RecyclerView & CardView in existing Android version. They said it is in support library. So, I should be able to use those with put "compileSdkVersion" to "Android-L". Right ?
I am trying to use those widgets without Android L Preview device or emulator.I have checked other questions on this matter. But, seems they all are trying Android-L with Android-L version.
Here is my dependencies.
compile 'com.android.support:support-v4:13.0.+'
compile 'com.android.support:recyclerview-v7:+'
Here is my target config
minSdkVersion 15
targetSdkVersion 20
Thanks in advance for any idea.
I just found the solution.
The reason why I can't build the App with RecyclerView & CardView while the targetSdkVersion and minSdkVersion is not "Android-L" is because internally Google designed to treat the preview version of OS differently comparing with original releases.
When I compile the App which contains the components from Android-L, the build tools locked minSdkVersion and targetSdkVersion to same level. The new supports libraries (RecyclerView, CardView, Palette, etc) are also locked into the L API level.
This behaviour is only happening on this Android-L preview release.
The fix for it is to put the following in AndroidManifest.xml.I didn't need to change anything on my gradle script.
<uses-sdk
tools:node="replace" />
Since version 0.11 of Android Gradle Plugin, it turned on a new Manifest Merger by default. It allows us to do some niffy stuffs. This specific configuration tells the manifest processor to replace any attributes from uses-sdk nodes in lower-priority manifest (such as library manifest in this case) with this attributes.
Since Gradle also inserts minSdkVersion and targetSdkVersion from your build.gradle into this uses-sdk node, that's all we really need to add.
Check here for more information related to this issue.
Check here for the info related to Manifest Merger.
The best solution is RecyclerViewLib. The support library has been pulled into a repo and published on maven central. It'll be safe even after L is released as all L dependent code has been removed. The author explains it here in his blog post.
To use it in your project just add the following line in your build.gradle dependencies:
compile 'com.twotoasters.RecyclerViewLib:library:1.0.+#aar'
Good luck!
No you must set targetSdkVersion above 7. You can use android support library v7 with project that support android above 7 api level.
And one more. Android L has api level 'android-L', not 20. Under the hood it has api level 21 (20 is 4.4W, KitKat for wearables).

Set merge strategy on AndoridManifest when using gradle and library projects

I have a gradle project that uses a library with a minSdkVersion set to api level 11. My application has a minSdkVersion of 9. When compiling I get the following error.
Main manifest has <uses-sdk android:minSdkVersion='9'> but library uses minSdkVersion='11'
I have seen a similar question titled manifest-merging-failed-android-studio but the solution was to change the library to have the same minSdk version. If you dont have control over the library that isnt possible.
The library is only used in situations where the minSdkVersion is higher than 11 so actual use isnt an issue.
Is there anyway to get the advantages manifest merging and let the library have a higher minSdk than your main project?
Workarounds that I have thought of but havent found a way to do.
Set priority if manifests conflict
Ignore minsdk for library projects
Remove minSdk from arr before merging starts

Categories

Resources