Hi, I am trying to fix below error: Could not reso...
# community-support
v
Hi, I am trying to fix below error: Could not resolve com.wei.android.libfingerprintidentify1.2.6. Required by: project :app > project :react-native-fingerprint-scanner Any help is appreciated. Thanks!
v
What is the full error? Can you share a build
--scan
URL?
v
* What went wrong: Execution failed for task 'appcheckReleaseDuplicateClasses'.
Could not resolve all files for configuration 'appreleaseRuntimeClasspath'.
> Could not resolve com.wei.android.libfingerprintidentify1.2.6. Required by: project :app > project :react-native-fingerprint-scanner > Could not resolve com.wei.android.libfingerprintidentify1.2.6. > Could not get resource 'https://repo.spring.io/plugins-release/com/wei/android/lib/fingerprintidentify/1.2.6/fingerprintidentify-1.2.6.pom'. > Could not HEAD 'https://repo.spring.io/plugins-release/com/wei/android/lib/fingerprintidentify/1.2.6/fingerprintidentify-1.2.6.pom'. Received status code 401 from server:
Well, thanks for replying!
v
Well, the repository answers with "401 Unauthorized", so you probably need credentials for that repository
Or the repository has some problems
v
Yes right but it was working before, this happened only after upgraded targetSdkVersion to 34
Was trying to fix the error and got one fix
Just tested the apk creation and looks to be working
In Build.gradle
I had
repositories { google() mavenCentral() maven { url 'https://maven.fabric.io/public' } }
and I added
jcenter()
Now it looks like
repositories { google() jcenter() mavenCentral() maven { url 'https://maven.fabric.io/public' } }
v
If that fixes anything you are in serious trouble
JCenter is finally going to die
v
Oops
I heard its suppose to be there infinitely in read only mode
So I used it
Any other solution?
v
Yeah, that changed recently
v
OMG, and this happened this month?
v
Work-around is to not use JCenter. Search another repository where what you need is present. If you find none, make the maintainer publish is somewhere else. If no maintainer is present, don't use the library anymore or find some other way like publishing it to some private repository or (of course bad) checking in the library along with your code.
v
Oh my
v
OMG, and this happened this month?
Was announced two weeks ago, yes
v
Now I need to get this fixed another way.
👌 1
Thanks a mio for clearing my misunderstandings
👌 1
I would have been in some cloud 9
😄
Back on earth
v
Actually, the code you showed does not really match the error you showed.
v
yes I know, I googled n applied the fix
v
The error says you get 401 from repo.spring.io. But the code you showed does not even declare that repo
Unless of course you apply a misbehaving plugin that adds the repository on your behalf which is particularly bad practice - at least for a public plugin.
And especially if that repository does not answer with 404 for not found artifacts, but with 401, which some repositories do and also is a misbehave as then also other repositories later in the list are not asked.
v
Oh okay
This is what I have in my gradle file
allprojects { repositories { configurations.all { resolutionStrategy { force 'androidx.corecore ktx1.6.0' force "com.facebook.reactreact native0.64.0" } } mavenCentral() mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } google() jcenter() maven { url 'https://www.jitpack.io' } // maven { url 'https://plugins.gradle.org/m2/' } // maven { url 'https://repo.spring.io/plugins-release/' } } }
I commented those 2 lines
Not sure how they affect but
v
Well, you probably did not have the second one commented when you sent that error in the response above and probably that repository is misbehaving, answering with 401 for absent artifacts instead of 404, which then produces an error instead of asking later repositories in the list or finally failing with a more clear error message of "no repository has the dependency"
Seems the maintainer of FingerprintIdentify did the horrendously bad decision to rely on JitPack for publishing in the future instead of doing proper publishing. So if you have the cursed, slow, buggy, broken-by-design, JitPack repo, you can use a dependency substitution rule to replace
com.wei.android.lib:fingerprintidentify
by
com.github.uccmawei:fingerprintidentify
and it will work if you happen to be lucky.
The next version of
react-native-fingerprint-scanner
also will do that change
This is just not yet released
And probably never will unless someone takes over maintenance, as it was abandoned too: https://github.com/hieuvp/react-native-fingerprint-scanner?tab=readme-ov-file#looking-for-maintainers
v
Hey, I was not well after that, just back today. I was able to fix this with your help.
Your info saying "Seems the maintainer of FingerprintIdentify did the horrendously bad decision to rely on JitPack for publishing in the future instead of doing proper publishing. So if you have the cursed, slow, buggy, broken-by-design, JitPack repo, you can use a dependency substitution rule to replace
com.wei.android.lib:fingerprintidentify
by
com.github.uccmawei:fingerprintidentify
and it will work if you happen to be lucky." helped
I used patch package to apply above and seems to be working
Thanks a tonn for help!
👌 1