Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Execution failed for task ':onesignal_flutter:compileReleaseJavaWithJavac'. #793

Closed
2 of 3 tasks
fabioselau077 opened this issue Nov 23, 2023 · 1 comment
Closed
2 of 3 tasks

Comments

@fabioselau077
Copy link

fabioselau077 commented Nov 23, 2023

What happened?

After run flutter build appbundle --target-platform android-arm,android-arm64,android-x64 -t lib/main.dart
return this:
error 'error: lambda expressions are not supported in -source 7 OneSignal.getNotifications().requestPermission(fallback, Continue.with(permissionResult -> { ^ (use -source 8 or higher to enable lambda expressions)'

Steps to reproduce?

1. onesignal_flutter: ^5.0.3

What did you expect to happen?

Build app appbundle

OneSignal Flutter SDK version

5.0.3

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

/Users/fabio/.pub-cache/hosted/pub.dev/onesignal_flutter-5.0.4/android/src/main/java/com/onesignal/flutter/OneSignalNotifications.java:81: error: lambda expressions are not supported in -source 7
        OneSignal.getNotifications().requestPermission(fallback, Continue.with(permissionResult -> {
                                                                                                ^
  (use -source 8 or higher to enable lambda expressions)
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':onesignal_flutter:compileReleaseJavaWithJavac'.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@fabioselau077
Copy link
Author

Resolved.
In android/build.gradle change classpath 'com.android.tools.build:gradle:4.1.0' to classpath 'com.android.tools.build:gradle:7.0.1' (upgrade to gradle) and add:
classpath 'com.google.gms:google-services:4.3.3', I don't know if it would make a difference, but I added it because I have another project like this and it's working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant