THEOplayer / react-native-connectors

THEOplayer React Native connectors
MIT License
3 stars 4 forks source link

Android build error: Could not find com.mux.stats.sdk.muxstats:muxstatssdktheoplayer_v5:0.2.0. #114

Closed davidwinograd1 closed 10 months ago

davidwinograd1 commented 10 months ago

Hello,

When I install the package @theoplayer/react-native-analytics-mux, I get an error for my Android device.

"Could not find com.mux.stats.sdk.muxstats:muxstatssdktheoplayer_v5:0.2.0."

I've tried adding this to my build.gradle:

 maven {
            url 'https://muxinc.jfrog.io/artifactory/default-maven-release-local'
            content {
                includeGroup 'com.mux.stats.sdk.muxstats'
            }
        }

which makes that error go away, but then gives me a new error: "Could not find com.mux:stats.muxcore:7.8.0"

Then I add in " includeGroup 'com.mux' " into the "content" part of the above code, so it becomes:

 maven {
            url 'https://muxinc.jfrog.io/artifactory/default-maven-release-local'
            content {
                includeGroup 'com.mux.stats.sdk.muxstats'
                includeGroup 'com.mux'
            }
        }

which gets rid of both "Could not find package" errors, but then gives me a new error: "Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors"

So now I'm stuck. Any help on what to do?

"react-native-theoplayer": "^3.0.2" "@theoplayer/react-native-analytics-mux": "^1.1.1",

@tvanlaerhoven

tvanlaerhoven commented 10 months ago

@davidwinograd1 We made an update to include jfrog.io artefactory in the root list, so you don't have to explicitly specify it anymore. We'll release the fix today in a 1.2.0 version.

As for the Incompatible classes issue, if you look at the complete error log, does it refer to mixed Kotlin versions? You can either align them yourself, or use kotlin-bom to do that.

tvanlaerhoven commented 10 months ago

@theoplayer/react-native-analytics-mux@1.2.0 has been published.

davidwinograd1 commented 10 months ago

@tvanlaerhoven 1.2.0 did fix the initial errors, but yes the Incompatible classes issue does refer to mixed Kotlin version. This is the only package where I get this error. I tried using kotlin-bom by adding this to the dependencies in my app-level build.gradle but the same errors still come.

implementation platform('org.jetbrains.kotlin:kotlin-bom') implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

anything I'm doing incorrectly or should add in order to use kotlin-bom correctly?

A snippet of my errors is below:

e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/davidwinograd/.gradle/caches/transforms-3/98a2c12c5bf8fda9d541cabbed40b5a6/transformed/jetified-kotlin-stdlib-common-1.9.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: /Users/davidwinograd/.gradle/caches/transforms-3/e729fbf7bfa60edb2c0d831ebba7920f/transformed/jetified-kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: /Users/davidwinograd/.gradle/caches/transforms-3/e729fbf7bfa60edb2c0d831ebba7920f/transformed/jetified-kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: /Users/davidwinograd/.gradle/caches/transforms-3/e729fbf7bfa60edb2c0d831ebba7920f/transformed/jetified-kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: /Users/davidwinograd/Rokfin/RokfinMobile/node_modules/@theoplayer/react-native-analytics-mux/android/src/main/java/com/theoplayermux/ReactTHEOplayerMuxModule.kt: (65, 30): Class 'kotlin.collections.TypeAliasesKt' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
tvanlaerhoven commented 10 months ago

@davidwinograd1 There's also the option to override the connector's Kotlin version with this property: THEOplayerMux_kotlinVersion. Maybe try to align it this way, by setting this value in your gradle.properties file, or build.gradle's buildScript.ext scope:

THEOplayerMux_kotlinVersion = "1.0.6"

https://github.com/THEOplayer/react-native-theoplayer-analytics/blob/main/mux/android/build.gradle#L76

davidwinograd1 commented 10 months ago

ah, I resolved it by putting kotlinVersion = "1.9.0" in my build.gradle. thanks!

davidwinograd1 commented 10 months ago

@tvanlaerhoven just pointing your attention to the request to re-open this issue:

https://github.com/THEOplayer/react-native-theoplayer-analytics/issues/113

it didn't actually go away when updating the package, I just commented out an important setup piece of code. any help you could provide would be greatly appreciated!