Closed thuytrinh closed 2 months ago
That's odd - i'm not sure I understand. Are you saying you have to downgrade your app to use 1.7 not 1.8?
Are you saying you have to downgrade your app to use 1.7 not 1.8?
No. It's Java 17 (seventeen) not 1.7. The flutter_libphonenumber_android
project isn't compatible with the toolchain that I've mentioned earlier.
Ah thanks. What's the output of flutter doctor -v for you?
[✓] Flutter (Channel stable, 3.10.2, on macOS 13.4 22F66 darwin-arm64, locale en-DE)
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9cd3d0d9ff (2 weeks ago), 2023-05-23 20:57:28 -0700
• Engine revision 90fa3ae28f
• Dart version 3.0.2
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Platform android-33, build-tools 33.0.2
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] Android Studio (version 2022.2)
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] IntelliJ IDEA Community Edition (version 2023.1.1)
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2023.1.2)
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.78.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.66.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4 22F66 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.106
[✓] Network resources
• All expected network resources are available.
• No issues found!
Thanks! Ok im testing some fixes now, going to push it to a branch and will ping you here to try it after that.
Issue seems to be this: https://kotlinlang.org/docs/gradle-configure-project.html#check-for-jvm-target-compatibility-of-related-compile-tasks
I think i solved it by bumping everything to the latest and moving compileSdk to 33. But i'm not sure if this will break it for backwards compatibility. Try this:
dependency_overrides:
flutter_libphonenumber_android:
git:
url: https://github.com/acoutts/flutter_libphonenumber.git
ref: bump-android-sdk-33
Opened https://github.com/acoutts/flutter_libphonenumber/pull/50
any update when a fix will land in the package? My project depends on the phone validation and is now stuck because it does not build the release version caused by this package.
The workaround is not working for me because it throws an error when building.
Execution failed for task :flutter_libphonenumber_android:compileReleaseJavaWithJavac.
error: invalid source release: 17
Also running into this issue with kotlin version 1.9.20
and gradle distribution URL of 8.4
. Above dependency override didn't work:
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).
I'm needing this upgrade too.
For now, I will use this overrides to flutter_libphonenumber_android
dependency_overrides: flutter_libphonenumber_android: git: url: https://github.com/acoutts/flutter_libphonenumber.git path: packages/flutter_libphonenumer_android # You forgot this line ref: bump-android-sdk-33
Face the same issue as well, the configuration is as below:
Same error here, I believe this error should be a priority
Fixed in v2.3.1
I have a Flutter project and its Android project is running with the following configuration:
After upgrading my Android Studio to Flamingo 2022.2.1 Patch 1, I had to point the Java home to the internal one inside Android Studio, which is jbr17. Then I had to upgrade the Android project to target Java 17 like below:
Afterwards I had a build error with the flutter_libphonenumber_android module:
So I guess the
flutter_libphonenumber_android
module needs an upgrade to be able to run with the latest Android build tool. For now, to overcome the issue, I had to work around like below in the root build file of my Android module: