Description:
No changes to any code, other that updating Flutter to the lastest dev and master channels.
Using the dev channel of flutter, using OneSignal causes this error:
E/AndroidRuntime( 7963): FATAL EXCEPTION: OSH_NetworkHandlerThread
E/AndroidRuntime( 7963): Process: com.myapp.myapp, PID: 7963
E/AndroidRuntime( 7963): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: OSH_NetworkHandlerThread
E/AndroidRuntime( 7963): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:794)
E/AndroidRuntime( 7963): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:727)
E/AndroidRuntime( 7963): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:140)
E/AndroidRuntime( 7963): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime( 7963): at com.onesignal.flutter.OSFlutterChangeTagsHandler.onSuccess(OneSignalTagsController.java:43)
E/AndroidRuntime( 7963): at com.onesignal.UserStateSynchronizer.internalSyncUserState(UserStateSynchronizer.java:196)
E/AndroidRuntime( 7963): at com.onesignal.UserStateSynchronizer.syncUserState(UserStateSynchronizer.java:170)
E/AndroidRuntime( 7963): at com.onesignal.UserStateSynchronizer$NetworkHandlerThread$1.run(UserStateSynchronizer.java:77)
E/AndroidRuntime( 7963): at android.os.Handler.handleCallback(Handler.java:790)
E/AndroidRuntime( 7963): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7963): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 7963): at android.os.HandlerThread.run(HandlerThread.java:65)
I believe that this is related to the following new change in flutter, and it has affected other plugins as well:
https://github.com/flutter/engine/commit/2c9e37c34e79475bbde7c8163eb5e56cdb9662a1
This appears to be the same issue as
https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/90
and
https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/95
Both of those issues (not mine) were closed not being able to reproduce, but I think you have to be on Flutter dev or master to reproduce it.
Hello, have you attempted changing the channel to 'stable' as mentioned in #90 ?
Yes, stable works fine, but there are 2 issues with that:
1
The change made in the beta/dev/master that is causing this problem is an intentional change, not a bug, and it will soon be pushed to the stable branch (I think they said it would be in July). So, using Stable is just pushing this issue down the road a few weeks instead of fixing it.
2
Also, for Android, Flutter is recommending using the dev/master branch to create builds because the stable branch is not creating the 64-bit versions properly to be accepted by the PlayStore.
I'm not sure exactly what the "Help Wanted" label is referring to, but there have been many plugins affected by this lately, and most of them have already been fixed now. There are several conversations in the Flutter github with the flutter people helping the plugin makers to fix their plugins regarding this error message.
I am not a Java developer but following other plugins, wrapping the native call in a Looper Handler works for me on flutter beta(1.6.3)
https://github.com/kaashyapan/OneSignal-Flutter-SDK
I also upgraded Gradle to 3.3.2. Happy to submit a PR if this can help.
I've tried changing the SDK version to 1.6.3. This works fine on my device (Redmi 4x) but is still Force Close on other devices. Is there any help? Because I have to use the dev channel for some reason
Thanks
@rikiyanuar Look at @kaashyapan fork, that one has the fix in it. Hopefully this will be implemented into the OneSignal official build, but there has been no official statement yet from them.
i had the same problem after upgrading the flutter to v.1.7.8+hotfix.2
I also have the same situation with the last update v.1.7.8+hotfix.2
I wish that OneSignal would give an official answer on this, other than just saying that the stable version works so it isn't a problem ... knowing that it was only a few days before the stable would be bumped up to the beta, which had the problem. And... here we are, the stable has been bumped up, so of course it doesn't work now.
Anyway, try using the @kaashyapan fork for now, it should be fixed there.
@uj thanks for advice. But I've tried the @kaashyapan fork but it still Force Close on my phone, which SDK version do you use for @kaashyapan fork?
this is working for me
https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/90#issuecomment-494901091
@uj thanks for advice. But I've tried the @kaashyapan fork but it still Force Close on my phone, which SDK version do you use for @kaashyapan fork?
_flutter beta(1.6.3)_.
Post your exception messages here if it is still a problem.
@rikiyanuar Are you getting the "@UiThread must be executed on the main thread" error message? It doesn't sound like you are, because that will stop it from building. You can't have a force close if you can't even build to begin with. If you are not getting that error message, then you should start another thread.
https://ucarecdn.com/51902472-9a6b-4f28-86bf-16ba2a886514/photo6138462419194849880.jpg
I really don't understand how it works, but the picture above is a screenshot of my phone. If my problem is not relevant for this thread, I'm sorry. I'll try to find my own ways.
Thanks for your advice
Thanks @kaashyapan for the fork
@rikiyanuar Sorry, I mis-wrote earlier. Yes, you have the problem described. If that fork doesn't work, then you have these 3 options: Try this other workaround https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/90 or wait for OneSignal to update their sdk, or go back to the previous 1.5.x stable release of Flutter.
Confirmed not working with flutter version v1.7.8-hotfix.3 on stable channel. Going back to 1.5.x solves the issue. The fork from @kaashyapan doesn't work for me.
After updating to 1.7.8-hotfix.3 on stable I am also getting the same error. I am assuming it affects everyone who is using onesignal now. Please fix this on priority.
Does anyone have a solution for this?
Any workaroud?
@Nightsd01 please help!!
E/AndroidRuntime(30306): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: OS_GETTAGS_CALLBACK
E/AndroidRuntime(30306): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:794)
E/AndroidRuntime(30306): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:727)
E/AndroidRuntime(30306): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:140)
E/AndroidRuntime(30306): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(30306): at com.onesignal.flutter.OSFlutterChangeTagsHandler.tagsAvailable(OneSignalTagsController.java:63)
E/AndroidRuntime(30306): at com.onesignal.OneSignal$15.run(OneSignal.java:1697)
E/AndroidRuntime(30306): at java.lang.Thread.run(Thread.java:764)
Init methods and subscribe methods doesn't seem to produce the crash. Anything related to tags (read/write) produce the ui thread error.
Does anyone have a solution for this?
Any workaroud?@Nightsd01 please help!!
For now, work with a previous version
command: flutter version v1.5.4-hotfix.2 <--- working
OneSignal please fix that, thanks. [Edit: from what I gather the developer in charge of this plugin left OneSignal. :-/]
This really is a shame, prevents me (and by the sounds of it pretty much everyone using this plugin) from updating into latest Flutter version.
Howdy everyone!
Thanks for your patience with this issue. We are almost there! @mikechoch has identified the root of the problem and is implementing a fix. We are just finishing up a couple of other issues in order to be able to push a new release. Apologies for the delay
Howdy everyone!
Thanks for your patience with this issue. We are almost there! @mikechoch has identified the root of the problem and is implementing a fix. We are just finishing up a couple of other issues in order to be able to push a new release. Apologies for the delay
Is there a approximate timeline for this? Aug 1 is the deadline for uploading 64bit app to playstore which was added in bundle on v1.7.8. If the fix is not going to be ready then we would need to have a plan B.
Howdy everyone!
Thanks for your patience with this issue. We are almost there! @mikechoch has identified the root of the problem and is implementing a fix. We are just finishing up a couple of other issues in order to be able to push a new release. Apologies for the delayIs there a approximate timeline for this? Aug 1 is the deadline for uploading 64bit app to playstore which was added in bundle on v1.7.8. If the fix is not going to be ready then we would need to have a plan B.
Joining the "pushing" on this issue resolution as we are against the time, we need an ETA for this to be socialized in order we all can plan based on it or as plan B, is there a way to have the 64bits build addition in v1.5.4, just in case? thanks in advance for the support
We just released onesignal_flutter 2.0.0 which fixes the "@UiThread" crashes. I confirmed this is now fixed even with the latest Flutter v1.7.8+hotfix.4 . Make sure to follow the migration guide in the release notes.
Thanks.
Upgraded to 2.0.0 but it won't compile. I'm getting these:
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:57: error: cannot find symbol
protected void runOnMainThread(@NonNull final Runnable runnable) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@NonNull final String methodName, @NonNull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@NonNull final String methodName, @NonNull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:34: error: cannot find symbol
@NonNull private AtomicBoolean replySubmitted = new AtomicBoolean(false);
^
symbol: class NonNull
location: class OSFlutterChangeTagsHandler
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':onesignal_flutter:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for 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 14s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.6 18G84, locale en-GB)
• Flutter version 1.7.8+hotfix.3 at /Users/lh/FlutterSDK/flutter
• Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/lh/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.6.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] Connected device (1 available)
• moto g 7 power • ZY323P7H6X • android-arm64 • Android 9 (API 28)
• No issues found!
Upgraded to 2.0.0 but it won't compile. I'm getting these:
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:57: error: cannot find symbol
protected void runOnMainThread(@nonnull final Runnable runnable) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@nonnull final String methodName, @nonnull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@nonnull final String methodName, @nonnull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:34: error: cannot find symbol
@nonnull private AtomicBoolean replySubmitted = new AtomicBoolean(false);
^
symbol: class NonNull
location: class OSFlutterChangeTagsHandler
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errorsFAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':onesignal_flutter:compileDebugJavaWithJavac'.Compilation failed; see the compiler error output for 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 14s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.Finished with error: Gradle task assembleDebug failed with exit code 1
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.6 18G84, locale en-GB)
• Flutter version 1.7.8+hotfix.3 at /Users/lh/FlutterSDK/flutter
• Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/lh/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.6.1[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)[✓] Connected device (1 available)
• moto g 7 power • ZY323P7H6X • android-arm64 • Android 9 (API 28)• No issues found!
I am getting the same thing
Below is what flutter doctor -v shows
[✓] Flutter (Channel beta, v1.7.8+hotfix.4, on Mac OS X 10.14.4 18E226, locale en-NG)
• Flutter version 1.7.8+hotfix.4 at /Users/temitopeomotunde/sdks/flutter
• Framework revision 20e59316b8 (4 days ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/temitopeomotunde/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• CocoaPods version 1.7.4
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.4 Preview.app/Contents
• Flutter plugin version 32.0.1
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b22)
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0
[✓] Connected device (1 available)
• SM G935F • 988678424631395845 • android-arm64 • Android 8.0.0 (API 26)
Upgraded to 2.0.0 but it won't compile. I'm getting these:
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:57: error: cannot find symbol
protected void runOnMainThread(@nonnull final Runnable runnable) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@nonnull final String methodName, @nonnull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/FlutterRegistrarResponder.java:61: error: cannot find symbol
protected void invokeMethodOnUiThread(@nonnull final String methodName, @nonnull final HashMap map) {
^
symbol: class NonNull
location: class FlutterRegistrarResponder
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java:69: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalPlugin
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:34: error: cannot find symbol
@nonnull private AtomicBoolean replySubmitted = new AtomicBoolean(false);
^
symbol: class NonNull
location: class OSFlutterChangeTagsHandler
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
/Users/lh/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal_flutter-2.0.0/android/src/main/java/com/onesignal/flutter/OneSignalTagsController.java:87: error: cannot find symbol
public void onMethodCall(@nonnull MethodCall call, @nonnull Result result) {
^
symbol: class NonNull
location: class OneSignalTagsController
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':onesignal_flutter:compileDebugJavaWithJavac'.Compilation failed; see the compiler error output for 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 14s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.6 18G84, locale en-GB)
• Flutter version 1.7.8+hotfix.3 at /Users/lh/FlutterSDK/flutter
• Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/lh/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.6.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] Connected device (1 available)
• moto g 7 power • ZY323P7H6X • android-arm64 • Android 9 (API 28)
• No issues found!I am getting the same thing
Below is what flutter doctor -v shows
[✓] Flutter (Channel beta, v1.7.8+hotfix.4, on Mac OS X 10.14.4 18E226, locale en-NG)
• Flutter version 1.7.8+hotfix.4 at /Users/temitopeomotunde/sdks/flutter
• Framework revision 20e59316b8 (4 days ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/temitopeomotunde/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• CocoaPods version 1.7.4[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.4 Preview.app/Contents
• Flutter plugin version 32.0.1
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b22)[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0[✓] Connected device (1 available)
• SM G935F • 988678424631395845 • android-arm64 • Android 8.0.0 (API 26)
Check this one
https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/110#issuecomment-514119279
Most helpful comment
Howdy everyone!
Thanks for your patience with this issue. We are almost there! @mikechoch has identified the root of the problem and is implementing a fix. We are just finishing up a couple of other issues in order to be able to push a new release. Apologies for the delay