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

Build error when integrating OneSignal following the Flutter SDK Setup guide #525

Closed
iAmWillShepherd opened this issue Jan 11, 2022 · 5 comments

Comments

@iAmWillShepherd
Copy link
Contributor

iAmWillShepherd commented Jan 11, 2022

Description

I followed the getting started guide to get up and running with Flutter, but I get the following error when I attempt to run the app on the Android simulator.

I also want to call out step 6.1 as being ambiguous: there is no mention of where in the file the code should be (i.e. Line 1, or the end of the file, or somewhere in between).

Environment

  1. Flutter 2.5.3
  2. I followed this instruction

Repro steps

  1. Follow the Flutter SDK Setup
  2. Once at step 7, run the app on Android.

Misc.

Shell output when trying to run on Android
╭─iamwill@zues ~/code/random/onesignal_flutter_sample/ios 
╰─$ flutter run                                                                                                  1 ↵
Changing current working directory to: /Users/iamwill/code/random/onesignal_flutter_sample
Multiple devices found:
sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 12 (API 31) (emulator)
iPhone 13 Pro Max (mobile)  • C4C4AF46-1101-4FF5-B2D9-82655CDB49CA • ios            •
com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
Chrome (web)                • chrome                               • web-javascript • Google Chrome 96.0.4664.55
[1]: sdk gphone64 arm64 (emulator-5554)
[2]: iPhone 13 Pro Max (C4C4AF46-1101-4FF5-B2D9-82655CDB49CA)
[3]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1
Using hardware rendering with device sdk gphone64 arm64. If you notice graphics artifacts, consider enabling software
rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
e: /Users/iamwill/.gradle/caches/transforms-2/files-2.1/a849fb59950567c1b835c07de721603e/work-runtime-2.6.0-api.jar!/META-INF/work-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* 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 13s
Running Gradle task 'assembleDebug'...                             14.2s
Exception: Gradle task assembleDebug failed with exit code 1
@emawby
Copy link
Contributor

emawby commented Jan 14, 2022

I managed to fix this by upgrading the kotlin version in build.gradle from

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.4.32'

@iAmWillShepherd
Copy link
Contributor Author

It appears that our Gradle plugin may be the culprit here. The comment above does work to unblock this issue, but we should fix our plugin to work with the default Kotlin version that flutter create defaults to.

@Not-Dhanraj
Copy link

I managed to fix this by upgrading the kotlin version in build.gradle from

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.4.32'

I am currently using kotlin version- 1.6.10 but i am still getting same error.

@westy92
Copy link
Contributor

westy92 commented Feb 9, 2022

Here's a related issue filed on the plugin repo: OneSignal/OneSignal-Gradle-Plugin#184

@emawby
Copy link
Contributor

emawby commented Jan 30, 2024

Closing issue as stale. If this is still happening in 2024 feel free to tag me to reopen

@emawby emawby closed this as completed Jan 30, 2024
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

4 participants