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

[BUG] Can't include 1.2.2 in Android Studio Kotlin build - unresolved dependencies #245

Open
radbobdad opened this issue Sep 10, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@radbobdad
Copy link

radbobdad commented Sep 10, 2024

Describe the bug
I can't figure out the right way to include a dependency on Skrape 1.2.2. I'm running Koala 2024.1.2 in a very vanilla out-of-the-box Android app environment. Gradle Sync works, but then build fails:

Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 4 files found with path 'META-INF/DEPENDENCIES' from inputs:
      - C:\Users\bobsm\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpasyncclient\4.1.4\f3a3240681faae3fa46b573a4c7e50cec9db0d86\httpasyncclient-4.1.4.jar
      - C:\Users\bobsm\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore-nio\4.4.13\3f897ace4d7f10f0ea6a58f524a3b105dd483653\httpcore-nio-4.4.13.jar
      - C:\Users\bobsm\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient\4.5.6\1afe5621985efe90a92d0fbc9be86271efbe796f\httpclient-4.5.6.jar
      - C:\Users\bobsm\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.4.13\853b96d3afbb7bf8cc303fe27ee96836a10c1834\httpcore-4.4.13.jar
     Adding a packaging block may help, please refer to
     https://developer.android.com/reference/tools/gradle-api/8.6/com/android/build/api/dsl/Packaging
     for more information

There is some indication on the Apache website that this is due to Google dropping HttpClient, however attempting to include it just makes things worse:

  • Including the recommended com.github.ok2c.hc4.android:httpclient-android:0.1.0 results in a minSdkVersion conflict
  • Moving to more recent version of 0.3.0 results in even more missing dependencies

Is there a solution to this issue?

Code Sample
If applicable, add a small sample code that illustrates the error.
implementation("it.skrape:skrapeit:1.2.2")

Expected behavior
Including the skrapeit recommended dependencies should result in a clean build in Android Studio.

Additional context
Add any other context about the problem here.

@radbobdad radbobdad added the bug Something isn't working label Sep 10, 2024
@radbobdad radbobdad changed the title [BUG] Can't include 1.2.2 in Android Studio build - unresolved dependencies [BUG] Can't include 1.2.2 in Android Studio Kotlin build - unresolved dependencies Sep 10, 2024
@radbobdad
Copy link
Author

radbobdad commented Sep 10, 2024

I have done some more investigating, and it appears work has been done to utilize KTor? But it doesn't appear to be ready for prime-time. Adding dependencies:

    implementation("it.skrape:skrapeit:1.3.0-alpha.2")
    //also with implementation("io.ktor:ktor-server-core:3.0.0-rc-1")
    //also with implementation("io.ktor:ktor-server-netty:3.0.0-rc-1")

results in:

Duplicate class it.skrape.fetcher.ExtensionsKt found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$WhenMappings found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$installBasicAuth$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$installBasicAuth$1$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$toHttpRequest$1$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$toHttpRequest$1$3 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$toResult$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$trustSelfSignedClient$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$trustSelfSignedClient$1$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2.jar -> skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2.jar -> skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants