OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.56k stars 373 forks source link

GradleProjectPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 #1247

Closed jeanlambert17 closed 3 years ago

jeanlambert17 commented 3 years ago

Description:

com/onesignal/androidsdk/GradleProjectPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Environment

"react-native": "0.64.2" "react-native-onesignal": "^4.1.1"

Steps to Reproduce Issue:

  1. Install OneSignal SDK using npm/yarn
  2. Install OneSignal for Android
  3. Try to sync gradle files with android studio

Anything else:

I was using RN version 63.2 which I update to 64.2. Also, I updated react-native-onesignal library following this doc: https://documentation.onesignal.com/docs/react-native-sdk-setup#step-3-install-for-android-using-gradle-for-android-apps

On iOS it works just fine, but, on android, I'm getting that error.

jkasten2 commented 3 years ago

@jeanlambert17 Thanks for reporting, this issue has been fixed in the 0.13.4 of the OneSignal-Gradle-Plugin.

I clean build should resulting in getting this new version automatically. However depending on your configuration it could take up to 24 hours for your system to decided to check for a new version. To refresh the cache however there are a few options.

Option 1 - One time refresh

From you project directory where your build.gradle file is located run: Windows:

gradlew.bat --refresh-dependencies

Linux / Mac:

./gradlew --refresh-dependencies

Option 2 - Change cacheDynamicVersionsFor

In your root build.gradle add the following section.

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}

Gradle reference: https://discuss.gradle.org/t/refresh-dependencies-should-use-cachechangingmodulesfor-0s/556/7