Closed tomdiz-epicorebiosystems closed 6 months ago
Hello @tomdiz-epicorebiosystems!
Most probably you have old OkHttp 3 version pinned by you or resolved by Gradle for the build environment classpath. The missing OkHttp3.Companion
class referenced in your error was introduced here and exists only since OkHttp 4.x release.
You can check which version of OkHttp is used in your build environment by running ./gradlew :<module>:buildEnvironment
task.
Our plugin expects to have OkHttp 4.x or above in the classpath.
Hi,
I ran the above command for my app (terminal window) and see com.squareup.okhttp3:okhttp:4.12.0 included. I also add the 4.12.0 jar to my classpath and got duplicate issues..
./gradlew :app:buildEnvironment
Configure project :app fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything.
Configure project :lib_service fatal: No names found, cannot describe anything.
Configure project :lib_ui fatal: No names found, cannot describe anything.
Configure project :profile_uart fatal: No names found, cannot describe anything.
Task :app:buildEnvironment
classpath +--- com.datadoghq.dd-sdk-android-gradle-plugin:com.datadoghq.dd-sdk-android-gradle-plugin.gradle.plugin:1.13.1 | --- com.datadoghq:dd-sdk-android-gradle-plugin:1.13.1 | +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.23 -> 1.8.10 | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.10 | | --- org.jetbrains:annotations:13.0 | +--- com.squareup.okhttp3:okhttp:4.12.0 | | +--- com.squareup.okio:okio:3.6.0 | | | --- com.squareup.okio:okio-jvm:3.6.0 | | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 -> 1.8.10 | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 () | | | | --- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10 | | | | --- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 () | | | --- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 -> 1.8.10 | | --- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.8.10 () | --- org.json:json:20180813 +--- org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin:1.9.10 | --- org.jetbrains.kotlin:kotlin-serialization:1.9.10 | +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.10 | | +--- org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.10 | | | +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.10 (c) | | | +--- org.jetbrains.kotlin:kotlin-serialization:1.9.10 (c) | | | +--- org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.10 (c) | | | +--- org.jetbrains.kotlin:kotlin-native-utils:1.9.10 (c) | | | --- org.jetbrains.kotlin:kotlin-tooling-core:1.9.10 (c) | | +--- org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.10 | | +--- org.jetbrains.kotlin:kotlin-native-utils:1.9.10 | | | +--- org.jetbrains.kotlin:kotlin-util-io:1.9.10 | | | --- org.jetbrains.kotlin:kotlin-util-klib:1.9.10 | | | --- org.jetbrains.kotlin:kotlin-util-io:1.9.10 | | +--- org.jetbrains.kotlin:kotlin-project-model:1.9.10 | | | --- org.jetbrains.kotlin:kotlin-tooling-core:1.9.10 | | --- org.jetbrains.kotlin:kotlin-tooling-core:1.9.10 | --- org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.10 () +--- org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.8.10} -> 1.8.10 (c) +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.8.10} -> 1.8.10 (c) +--- org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.8.10} -> 1.8.10 (c) +--- org.jetbrains:annotations:{strictly 13.0} -> 13.0 (c) --- org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.8.10} -> 1.8.10 (c)
(c) - A dependency constraint, not a dependency. The dependency affected by the constraint occurs elsewhere in the tree. (*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation.
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 814ms 1 actionable task: 1 executed
@tomdiz-epicorebiosystems By looking on the buildEnvironment
output I can see that the necessary OkHttp version exists in your build classpath, there is no need to add a jar
manually. Did you try to make a clean build by removing all build cache files? What if you update Kotlin version used in your project to 1.9, does this issue still occur?
Hi,
I removed all cache files and verified I'm using Kotlin 1.9. The issue still occurred. I was using the Nordic Semiconductor Android-BLE-Library (with gradle lib version 1.9.13) in my project. I finally figured out they are pulling in okHttp 3.x and that was causing the failure of uploadMappingRelease with crash exception. I upgraded Noridic libs by removing there gradle lib and adding fixed lib versions of there Libraries. It is working fine now. Thx for your help.
@tomdiz-epicorebiosystems glad to hear the issue is resolved now!
Do a successful release build (
mapping.txt
file in default release folder). ExportDD_API_KEY
with my API key and then run./gradlew uploadMappingRelease
from the Terminal window. Get this crash:Android Build Tools version:
Gradle version: 8.4
OS version: MacOSX 14.4.1
Plugin version: 1.13.1
Proguard configuration:
Other Gradle Plugins: id("com.datadoghq.dd-sdk-android-gradle-plugin") version "1.13.1" id("org.jetbrains.kotlin.plugin.serialization") version "1.9.10" // NOTE: This needs to match kotlin version
My gradle file contains:
At the bottom of my gradle file is: