UnifiedPush / flutter-connector

Mirror of https://codeberg.org/UnifiedPush/flutter-connector
Apache License 2.0
31 stars 11 forks source link

Compile unifiedpush_android with a more recent Java version #151

Closed provokateurin closed 1 month ago

provokateurin commented 3 months ago

It seems like Java 8 is still used, but most apps moved on to newer versions. It doesn't create a conflict, but you are forced to have two Java versions installed, if your app is not compiled with Java 8.

adar2378 commented 3 months ago

@provokateurin I am facing similar issues

Could not determine the dependencies of task ':unifiedpush_android:compileDebugKotlin'.

Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific} Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available. Could not read 'https://api.adoptopenjdk.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk' as it does not exist.

provokateurin commented 3 months ago

The fix is to have Java 8 installed besides the Java version you need to compile your app.

adar2378 commented 3 months ago

@provokateurin Thanks for your response. Any other configuration changes required within the app's build.gradle file or something? What about setting JAVA_HOME?

provokateurin commented 3 months ago

Nothing that I am aware of

nucleus-ffm commented 1 month ago

I had the same error and just increased the jvmToolchain version to 11 in https://github.com/UnifiedPush/flutter-connector/blob/ca5ed6d078735235c261b8f7ba430a1a36d46203/unifiedpush_android/android/build.gradle#L35

I'm not sure if that may have any drawbacks later, but for now, it seems to work without any problem.

gwbischof commented 1 month ago

It would be great if we could update the Java version.

provokateurin commented 1 month ago

CC @p1gp1g @theonewiththebraid for the recent discussions in the Matrix room

TheOneWithTheBraid commented 1 month ago

This is fixed with https://github.com/UnifiedPush/android-connector/pull/95 .

provokateurin commented 1 month ago

Thanks, then I'll close this :)

TheOneWithTheBraid commented 1 month ago

And related (now that the Android-native part is done) #154 - same patch.