Closed khaled-0 closed 1 month ago
This happens due to compileSdk not targeting latest sdk 34 in library.
As a workaround do this in
android/build.gradle
rootProject.buildDir = '../build'
// FIX for Flutter 3.24
subprojects {
afterEvaluate {
android {
compileSdkVersion 34
}
}
}
// Must be before this block
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
So still on Flutter version 3.24.1 upgrade with build fail. See error below. Please anyone with a solution? I tried the hack but failed
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_native_contact_picker:compileReleaseKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).
Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 4s
Running Gradle task 'assembleRelease'... 4.5s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1`
So still on Flutter version 3.24.1 upgrade with build fail. See error below. Please anyone with a solution? I tried the hack but failed
Running Gradle task 'assembleRelease'... FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':flutter_native_contact_picker:compileReleaseKotlin'. > Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17). Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 4s Running Gradle task 'assembleRelease'... 4.5s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1`
you're probably getting this error in GitHub Action just add the following lines to your workflow
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
check-latest: true
This ensures Java 17 is installed on the system
Not in github action but Android Studio
So still on Flutter version 3.24.1 upgrade with build fail. See error below. Please anyone with a solution? I tried the hack but failed
Running Gradle task 'assembleRelease'... FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':flutter_native_contact_picker:compileReleaseKotlin'. > Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17). Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 4s Running Gradle task 'assembleRelease'... 4.5s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1`
I am having the same error, I have looked at the gradle settings of the plugin, it doesn't target compileSdkVersion 34, and so will continue to break. So unfortunate
Wha t I did was to copy the code (either from github or .../.pub-cache/hosted/pub.dev/flutter_native_contact_picker-0.0.7
on your computer) and paste on a file I created. Then replace the import. That's all. No more breaking changes
same problem +1
please upgrade the android version, please
@khaled-0 Can you please try with 0.0.8 pre version, its still under development, in android device its work fine.
Lets me know if its work for you.
@khaled-0 Can you please try with 0.0.8 pre version, its still under development, in android device its work fine.
Lets me know if its work for you.
I tried 0.0.8 pre , it is ok
@khaled-0 Can you please try with 0.0.8 pre version, its still under development, in android device its work fine. Lets me know if its work for you.
I tried 0.0.8 pre , it is ok
@khaled-0 @wenchaosong @Mvhd @Captured-Heart i have update pre release plugin for ios as well as, lets me know if you facing any ossue.
Thanks.
@jayeshpansheriya, I have implemented the prerelease and it's working perfectly after upgrading to the latest Flutter SDK. Thank you
Thanks, Works 👍. I'm still keeping the issue open for new users. Feel free to close this anytime.
I'm on the git master branch