exponea / exponea-react-native-sdk

MIT License
8 stars 13 forks source link

Could not build with react-native version 0.63.5 #84

Closed thuongtv-vn closed 1 year ago

thuongtv-vn commented 1 year ago

Hi All,

I am facing the build error while integrate this library into my application which is using react-native version: 0.63.5.

The error is below:


* What went wrong:

> Could not resolve all artifacts for configuration ':classpath'.

   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20.

     Required by:

         project :

      > The consumer was configured to find a runtime of a component compatible with Java 11, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20:

          - gradle70JavadocElements

          - gradle70RuntimeElements

          - gradle70SourcesElements

          - gradle71JavadocElements

          - gradle71RuntimeElements

          - gradle71SourcesElements

          - javadocElements

          - runtimeElementsWithFixedAttribute

          - sourcesElements

        All of them match the consumer attributes:

          - Variant 'gradle70JavadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides javadocs but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'gradle70RuntimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides a library but the consumer didn't ask for it

                  - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'gradle70SourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides sources but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'gradle71JavadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides javadocs but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.1' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'gradle71RuntimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides a library but the consumer didn't ask for it

                  - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.1' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'gradle71SourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides sources but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides attribute 'org.gradle.plugin.api-version' with value '7.1' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'javadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides javadocs but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides release status but the consumer didn't ask for it

          - Variant 'runtimeElementsWithFixedAttribute' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides a library but the consumer didn't ask for it

                  - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it

                  - Provides release status but the consumer didn't ask for it

          - Variant 'sourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a runtime of a component, and its dependencies declared externally:

              - Unmatched attributes:

                  - Provides documentation but the consumer didn't ask for it

                  - Provides sources but the consumer didn't ask for it

                  - Doesn't say anything about its target Java version (required compatibility with Java 11)

                  - Doesn't say anything about its elements (required them packaged as a jar)

                  - Provides release status but the consumer didn't ask for it

        The following variants were also considered but didn't match the requested attributes:

          - Variant 'apiElementsWithFixedAttribute' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component

          - Variant 'gradle70ApiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component

          - Variant 'gradle71ApiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:

              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component

It looks like to does support this react-native version. Do you guys know what minimum react-native version is required?

Thanks

adam1929 commented 1 year ago

Hi @thuongtv-vn thank you for your report. From error, I can see that problem is with your kotlin and gradle version support. Please try latest SDK and also check for gradle version we are using: https://github.com/exponea/exponea-react-native-sdk/blob/master/example/android/gradle/wrapper/gradle-wrapper.properties

I can tell, that you need Java 11 and use gradle 7.1+ for kotlin 1.7.20 to be able to build Android apk: https://kotlinlang.org/docs/whatsnew1720.html#gradle

This error is not related to your RN version.