fluttercommunity / wakelock_plus

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, Linux, and web.
BSD 3-Clause "New" or "Revised" License
49 stars 38 forks source link

Execution failed for task ':wakelock_plus:compileReleaseJavaWithJavac'. > error: invalid source release: 17 #60

Open bassamalkhateb opened 1 month ago

bassamalkhateb commented 1 month ago

**

Execution failed for task ':wakelock_plus:compileReleaseJavaWithJavac'.

error: invalid source release: 17

**

compileSdk 34 ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

classpath 'com.android.tools.build:gradle:7.3.1'

ext.kotlin_version = '1.9.10'

Merlinski commented 1 month ago

Same problem here

eleojasmil commented 1 month ago

Same Problem here, any solution?

diegotori commented 1 month ago

As per version 1.2.0:

Library now requires Java 17 or higher and your app must build on API 34 (14 Upside Down Cake) on Android.

Merlinski commented 1 month ago

Thanks for your response. Issue still there with:

`compileSdkVersion 34 ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = '1.8'
}`
diegotori commented 1 month ago

Run flutter pub upgrade. Also, run flutter clean so that it rebuilds from scratch.

Merlinski commented 1 month ago

ok, thanks. i think the problem was an overridden transitive dependency of package_info_plus (overriden to 4.2.0). But that justs switched the problem to package_info_plus:

Execution failed for task ':package_info_plus:compileReleaseJavaWithJavac'. error: invalid source release: 17

To be precise i changed the jvmTarget to 17 too. As mentioned here #2723 i made the same changes.

Hemant301 commented 1 month ago

plz tell how to solve this error

Merlinski commented 1 month ago

For me the problem is solved exacly as dexcibed here..

If u depend on package_info_plus too and have issue with it have a look at package_info_plus changelog

there are some requirements to fullfill since version 6.0.0 in my case i hade to migrate to grade 8.4 for android part