Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate class bolts.* #1028

Closed
Azaratur opened this issue May 16, 2020 · 20 comments · Fixed by #1033
Closed

Duplicate class bolts.* #1028

Azaratur opened this issue May 16, 2020 · 20 comments · Fixed by #1033

Comments

@Azaratur
Copy link

This is my setting:
implementation "com.github.parse-community.Parse-SDK-Android:parse:1.24.1"
implementation "com.github.parse-community.Parse-SDK-Android:facebook:1.24.1"
implementation 'com.github.parse-community:ParseLiveQuery-Android:1.1.0'

And this is what i got:
Duplicate class bolts.Capture found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)

@Azaratur
Copy link
Author

Azaratur commented May 16, 2020

Temporally fixed by adding:

{
      exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}

and forking ParseLiveQuery, those are "pointing" to older ParseSDK

@rogerhu
Copy link
Contributor

rogerhu commented May 16, 2020

Thanks for the bug report -- parse-community/ParseLiveQuery-Android#107

@pc-cesar
Copy link

i have the same erro error :Program type already present: bolts.AndroidExecutors

Libs:
implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.24.1'
implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.24.1"
implementation 'com.github.parse-community.Parse-SDK-Android:facebook:1.24.1'
implementation 'com.github.parse-community:ParseLiveQuery-Android:1.2.0'

i try --> exclude group: 'com.parse.bolts', module: 'bolts-tasks'; but not solved my problem

@Azaratur
Copy link
Author

Azaratur commented May 28, 2020

Yes i still that issue too, but i did solve it whit this:
implementation ("com.github.parse-community.Parse-SDK-Android:parse:1.24.1")
{
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation ("com.github.parse-community.Parse-SDK-Android:facebook:1.24.1")
{
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation ("com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1")
{
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation ('com.github.parse-community:ParseLiveQuery-Android:1.2.0')
{
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}

@pc-cesar
Copy link

pc-cesar commented May 28, 2020

not solved to me :(

get the same error:

AGPBI: {"kind":"error","text":"Program type already present: bolts.AggregateException","sources":[{}],"tool":"D8"}

@Jawnnypoo
Copy link
Member

Can you list out all your dependencies and version numbers?

@pc-cesar
Copy link

implementation 'org.slf4j:slf4j-nop:1.5.8'

implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'

implementation 'com.google.firebase:firebase-core:16.0.8'

implementation 'com.google.android.gms:play-services-maps:17.0.0'

implementation 'com.google.android.gms:play-services-location:17.0.0'

implementation 'com.google.android.libraries.places:places:2.1.0'

implementation 'org.apache.commons:commons-lang3:3.4'

implementation 'com.snappydb:snappydb-lib:0.5.2'

implementation 'com.esotericsoftware.kryo:kryo:2.24.0'

implementation 'com.google.maps.android:android-maps-utils:0.5'

implementation('com.digits.sdk.android:digits:2.0.5@aar') {
    transitive = true
}
implementation 'androidx.appcompat:appcompat:1.0.0'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation 'commons-net:commons-net:3.5'

implementation 'com.elyeproj.libraries:loaderviewlibrary:1.5.0'

implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true
}

**//Parse**
implementation("com.github.parse-community.Parse-SDK-Android:parse:1.24.1") {
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation("com.github.parse-community.Parse-SDK-Android:facebook:1.24.1") {
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation("com.github.parse-community.Parse-SDK-Android:fcm:1.24.1") {
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation("com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1") {
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
implementation('com.github.parse-community:ParseLiveQuery-Android:1.2.0') {
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}

implementation 'com.squareup.picasso:picasso:2.5.2'

implementation 'com.squareup.okhttp:okhttp:2.4.0'

implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

implementation 'androidx.recyclerview:recyclerview:1.1.0'

testImplementation 'junit:junit:4.12'

androidTestImplementation 'androidx.annotation:annotation:1.1.0'

androidTestImplementation 'androidx.test.ext:junit:1.1.1'

implementation 'com.facebook.android:facebook-android-sdk:5.8.0'

implementation 'androidx.room:room-runtime:2.2.3'

annotationProcessor 'androidx.room:room-compiler:2.2.3'

implementation 'com.madgag.spongycastle:pkix:1.51.0.0'

implementation 'me.zhanghai.android.materialratingbar:library:1.3.2'

implementation 'com.android.volley:volley:1.1.1'

implementation 'com.sothree.slidinguppanel:library:3.4.0'

//implementation 'com.facebook.android:account-kit-sdk:4.39.0'

implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.9'

implementation 'com.sothree.slidinguppanel:library:3.4.0'

implementation 'androidx.multidex:multidex:2.0.1'

implementation 'com.squareup.retrofit2:retrofit:2.5.0'

implementation 'com.squareup.retrofit2:converter-gson:2.5.0'

implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'

implementation 'com.squareup.okhttp3:okhttp:3.12.1'

implementation 'com.airbnb.android:lottie:3.3.1'

implementation 'com.github.mayuce:LottieAlertDialog:1.1'

implementation "androidx.core:core-ktx:1.1.0"

implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation "androidx.viewpager2:viewpager2:1.0.0"

implementation "com.google.android.material:material:1.1.0"

implementation 'androidx.navigation:navigation-fragment-ktx:2.2.0'

implementation 'androidx.navigation:navigation-ui-ktx:2.2.0'

implementation 'io.fotoapparat:fotoapparat:2.7.0'

implementation 'com.flurry.android:analytics:11.4.0@aar'

@Jawnnypoo
Copy link
Member

If you remove live-query, does it work?

@pc-cesar
Copy link

pc-cesar commented May 28, 2020

not,the error continue

@Azaratur
Copy link
Author

Pc-cesar can you paste the error message?
It should indicate which library import bolt and which one is in conflict.

@vernazza
Copy link

vernazza commented Jun 3, 2020

This is the error I get:

Duplicate class bolts.AggregateException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.AndroidExecutors found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.AndroidExecutors$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.AndroidExecutors$UIThreadExecutor found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.BoltsExecutors found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.BoltsExecutors$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.BoltsExecutors$ImmediateExecutor found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.CancellationToken found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.CancellationTokenRegistration found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.CancellationTokenSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.CancellationTokenSource$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Capture found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Continuation found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.ExecutorException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$10 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$11 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$12 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$13 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$14 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$15 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$15$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$2 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$3 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$4 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$5 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$6 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$7 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$8 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$9 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$TaskCompletionSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.Task$UnobservedExceptionHandler found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.TaskCompletionSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.UnobservedErrorNotifier found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
Duplicate class bolts.UnobservedTaskException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)

@mtrezza
Copy link
Member

mtrezza commented Jun 17, 2020

The bolts-tasks module has been added natively to this library in #1018 without changing its name.

This creates a bolts-tasks module with version of the Parse Android SDK:

com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1

The original Bolts framework is still being used by the Facebook Android SDK which is transitively added by the Parse Android SDK and/or as a regular project dependency.

+--- com.github.parse-community.Parse-SDK-Android:facebook:1.24.1
|    \--- com.facebook.android:facebook-login:6.3.0 -> 7.0.1
|         +--- com.facebook.android:facebook-core:7.0.1
|         |    +--- com.parse.bolts:bolts-android:1.4.0
|         |    |    +--- com.parse.bolts:bolts-tasks:1.4.0
|         |    |    \--- com.parse.bolts:bolts-applinks:1.4.0
|         |    |         \--- com.parse.bolts:bolts-tasks:1.4.0
+--- com.facebook.android:facebook-android-sdk:7.0.1
|    +--- com.facebook.android:facebook-applinks:7.0.1
|    |    +--- com.parse.bolts:bolts-android:1.4.0 (*)
|    +--- com.facebook.android:facebook-messenger:7.0.1
|    |    +--- com.facebook.android:facebook-core:7.0.1 (*)
|    |    \--- com.parse.bolts:bolts-android:1.4.0 (*)

The result is the same bolts-tasks module with different versions and duplicate classes.

com.parse.bolts:bolts-tasks:1.4.0

Note: The underlying issue seems to be that the Bolts framework and the Parse Platform share the same package domain com.parse. Now we have a legacy module that is not managed by Parse Platform sharing the same domain space. So another solution would be to change the domain from com.parse to something like com.parseplatform or com.parsecommunity for the open source project.

@mtrezza
Copy link
Member

mtrezza commented Jun 17, 2020

@rogerhu @Jawnnypoo

  • Can you please review the PR and make a new release, the currently release is broken, since 1.24.0.
  • We should try to add a test case, because these release should have failed in the first place.
  • A warning note should be added to the change log and release page that these releases should not be used. The change log is also out of sync with the release page. I'll add the warnings to the change log and put them in sync in Fix bolts duplicate classes #1033.
  • Obviously this repo needs maintainers, because the issues are piling up here and we have a broken release for months. How about pinning a call for additional maintainers to this repo? @acinader @TomWFox

@Jawnnypoo
Copy link
Member

Adding a test case would be very difficult since it involves including the Facebook SDK too and is a compilation issue, not a code issue.

The release is broken for those who use the Facebook SDK + Parse-SDK, not everyone. Totally agree with having more maintainers though, this is a huge SDK with lots of nuance to it, so the more maintainers, the better.

@mtrezza
Copy link
Member

mtrezza commented Jun 17, 2020

The release is broken for those who use the Facebook SDK + Parse-SDK

It's broken also for those who use the Parse SDK's own facebook module because of transitivity. So we don't need to include the FB SDK separately.

+--- com.github.parse-community.Parse-SDK-Android:facebook:1.24.1
|    \--- com.facebook.android:facebook-login:6.3.0 -> 7.0.1
|         +--- com.facebook.android:facebook-core:7.0.1
|         |    +--- com.parse.bolts:bolts-android:1.4.0
|         |    |    +--- com.parse.bolts:bolts-tasks:1.4.0
|         |    |    \--- com.parse.bolts:bolts-applinks:1.4.0
|         |    |         \--- com.parse.bolts:bolts-tasks:1.4.0

@Jawnnypoo
Copy link
Member

True. I released 1.24.2 with this fix.

@pc-cesar
Copy link

Thanks a lottt!! Sorry for not answer your question!!!

@TomWFox
Copy link
Contributor

TomWFox commented Jun 18, 2020

Obviously this repo needs maintainers, because the issues are piling up here and we have a broken release for months. How about pinning a call for additional maintainers to this repo?

I've added a pinned issue asking for maintainers - hopefully it looks ok!

@mtrezza
Copy link
Member

mtrezza commented Jun 18, 2020

Great, it looks perfect!

@romanbsd
Copy link

It's quite unfortunate that the Bolts is not an external package. We're using Bolts in different modules in our app, and they cannot interoperate if we upgrade the SDK. Consider extracting the bolts package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants