EddyVerbruggen / nativescript-fingerprint-auth

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner or facial recognition!
MIT License
134 stars 33 forks source link

Android: minSdkVersion 17 cannot be smaller than version 23 #31

Closed sebawita closed 6 years ago

sebawita commented 6 years ago

hey,

I am trying to add nativescript-fingerprint-auth.

When I build for Android, I am getting this error:

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 23 declared in library [com.github.JesusM:FingerprintManager:v2.0.2] /Users/witalec/.gradle/caches/transforms-1/files-1.1/FingerprintManager-v2.0.2.aar/cbc3c418a7ed90935aaea75c6cf2ad9a/AndroidManifest.xml as the library might be using APIs not available in 17
        Suggestion: use a compatible library with a minSdk of at most 17,
                or increase this project's minSdk version to at least 23,
                or use tools:overrideLibrary="com.jesusm.kfingerprintmanager" to force usage (maylead to runtime failures)

my AndroidManifest.xml has the following setting:

<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="__APILEVEL__"/>

My runtime is:

"tns-android": {
    "version": "4.0.0-rc-2018.3.22.1"
}

but I also tried with:

"tns-android": {
"version": "3.4.0"
}

I am using NativeScript@rc

Any idea what I am doing wrong?

EddyVerbruggen commented 6 years ago

Can you please try with tns-android 3.4? This may be a bug in 4.0 because the plugin actually does exactly what that error you posted recommends (because I ran into it as well):

https://github.com/EddyVerbruggen/nativescript-fingerprint-auth/blob/b074307a84352eb66e88618aa46c987cd5da80e4/src/platforms/android/AndroidManifest.xml#L7

sebawita commented 6 years ago

actually... it does work with 3.4. So this is just a NativeScript issue

EddyVerbruggen commented 6 years ago

Yeah, I guess we'll need to report this breaking change in the tns-android project.

wanpeng2008 commented 6 years ago

The same issue under nativescript 4.0.0 tns-android 4.0.1

RoyiNamir commented 6 years ago

@sebawita Same here . Did you solve / open an issue about it ?

glen-stephens commented 6 years ago

Same issue here under nativescript 4.0.0 tns-android 4.0.1. Verified it works under nativescript 3.4. What is the best workaround until this get fixed? Really don't want to change my minSdkVersion to 23.

mikaelkalt commented 6 years ago

@sebawita I'm struggling with the same issue, but if you really want to increase your minSdkVersion you have to do it in the app.gradle

android {
    defaultConfig {
        minSdkVersion 23 
    }
}
mikaelkalt commented 6 years ago

Another workaround I've just figured out, is to manipulate your App_Resources/Android/AndroidManifest.xml manually and adding what @EddyVerbruggen mentioned before: <uses-sdk tools:overrideLibrary="com.jesusm.kfingerprintmanager"/>

Important: It needs to be before the the line that defines your minSdkVersion.

glen-stephens commented 6 years ago

@mikaelkalt Thanks for the help! I had the tools:overrideLibrary and it wasn't working but I didn't know it needed to be before the minSdkVersion line. Appreciate it!

EddyVerbruggen commented 6 years ago

Looks like I'll be adding a comment in the readme to add something like this, thanks guys!

  <!-- if your minSdkVersion is < 23, then make sure you add that 'overrideLibrary' line -->
  <uses-sdk
      android:minSdkVersion="17"
      android:targetSdkVersion="__APILEVEL__"
      tools:overrideLibrary="com.jesusm.kfingerprintmanager"/>
kleingtm commented 6 years ago

Worth noting -- That solution finally worked for me, but I had to blow away the gradle cache: rm -rf ~/.gradle/caches

kleingtm commented 6 years ago

... and, of course, the dist folder / whatever folder you're building into.

M-Ali-B commented 5 years ago

Well my problem was solved when i changed the minSdkVersion in both (module:app) and (module:base) to 23 My error was because the merger failure of manifest file of (module:app) and (module:base) , the reason was that minSdkVersion was different in both of the files .

ryanammons commented 5 years ago

Did this actually get reported to NS team? It's still an issue, and I don't like having to target minimum 23.