OneSignal / OneSignal-Gradle-Plugin

Use with OneSignal-Android-SDK to help integrate it into your Android Studio or Gradle project. https://onesignal.com
Other
64 stars 17 forks source link

Getting this issue while building android build in react native #161

Closed tejprakashtiwary closed 3 years ago

tejprakashtiwary commented 3 years ago

> Could not resolve all artifacts for configuration ':app:classpath'.
   > Could not resolve gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99].
     Required by:
         project :app
      > No matching variant of gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 was found. The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally but:
          - Variant 'apiElements' capability gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 declares a component, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
          - Variant 'runtimeElements' capability gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 declares a runtime of a component, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8```

Please tell me what to do? It was running fine but suddenly giving this message. Even ./gradlew clean is also not working and giving above.
danielehrhardt commented 3 years ago

Same Problem here


* Where:
Script '/Users/vagrant/git/android/app/capacitor.build.gradle' line: 28
* What went wrong:
A problem occurred evaluating script.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not resolve gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.3, 0.99.99].
     Required by:
         unspecified:unspecified:unspecified
      > No matching variant of gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 was found. The consumer was configured to find a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally but:
          - Variant 'apiElements' capability gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 declares a component, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
          - Variant 'runtimeElements' capability gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.2 declares a runtime of a component, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
beisert1 commented 3 years ago

Same issue here, just started today with no changes made.

Hless commented 3 years ago

Temporary fix described here (for react-native, but works the same): https://github.com/OneSignal/react-native-onesignal/issues/1246

jkasten2 commented 3 years ago

Thanks for reporting! This was due to an unintentional Java 11 requirement introduced in 0.13.2. Some internal dependencies to OneSignal-Gradle-Plugin where updated which automatically intruded the version bump. We have lowered the Java JVM requirement back down to version 8 in Release 0.13.3.

Update: Use Release 0.13.4 instead of 0.13.3 as some .class files were built with Java 11 instead of Java 8 as was resolved in this version.

Related