maseh
February 28, 2023, 8:27pm
1
SDK Name: Flutter SDK
Version: 1.0.3
Im using firebase and flutter. On ios, web3auth is integrating fine, but on android emulator, I’m getting a duplicate class error. The torus android sdk that the web3auth flutter package uses is using com.google.protobuf:protobuf-lite:3.0.1
while cloud_firestore flutter package uses com.google.protobuf:protobuf-javalite:3.21.7
. These have conflicting class names but I’m not sure the best way to resolve them.
Are other firebase flutter users experiencing this issue? How are people resolving these dependencies and does the web3auth team plan on switching from protobuf-lite to protobuf-javalite?
Screenshot when I try to run my app on android emulator:
When checking the dependency tree on gradle, this is what I’m seeing for cloud_firestore:
And for web3auth:
@shahbaz please have a look
1 Like
Hey @maseh
Could you share your dependencies from your pubspec.yaml
file here?
Meantime, can you check whether this issue persists with this example we made with the same combination? examples/flutter/flutter-firebase-example at main · Web3Auth/examples · GitHub
1 Like
maseh
March 2, 2023, 1:14am
4
I’ve narrowed it down to two dependencies, one is a KYC provider (persona) and the other is firestore (firebase).
Using your example, I can reproduce the error by adding those two dependencies. I get the duplicate class errors for protobuf and for bouncycastle.
If I revert the web3auth flutter sdk to version 1.0.3 (not 1.1.0), the error disappears and everything works.
Here is the error state:
Here is the working state:
Thanks for testing the scenarios @maseh
Let me share this with our Engineering team to find a fix in the latest version.
1 Like
gaurav
March 2, 2023, 4:45am
6
@maseh Add “android.enableJetifier=true” in “gradle.properties” file. It should resolve error.
maseh
March 2, 2023, 5:05am
7
Hi Gaurav it’s already set to true:
gaurav
March 2, 2023, 6:20am
8
1 Like
gaurav
March 4, 2023, 3:34am
9
We have released new flutter version v1.1.2
2 Likes
maseh
March 4, 2023, 4:08am
10
Awesome, thank you Gaurav!!
maseh
March 6, 2023, 2:41pm
11
Hey Gaurav, I see that you’ve updated it on github, any idea when the update will be added to pub?
gaurav
March 7, 2023, 5:07am
12
@maseh Released in pub.dev too.
1 Like
I was also facing the same issue yesterday Duplicate class com.web3auth.core.types.WhiteLabelData found in modules
.
I was able to resolve the issue by removing implementation 'com.github.Web3Auth:web3auth-android-sdk:4.0.8'
from build.gradle.
I took the reference from here: https://github.com/Web3Auth/web3auth-pnp-examples/blob/main/flutter/flutter-example/android/app/build.gradle
The app is working fine and I am using Custom authentication with JWT token.
Is this the expected?
1 Like