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

App Crash: Take off must be called before shared() #14

Closed
AE1NS opened this issue Aug 15, 2022 · 13 comments
Closed

App Crash: Take off must be called before shared() #14

AE1NS opened this issue Aug 15, 2022 · 13 comments

Comments

@AE1NS
Copy link

AE1NS commented Aug 15, 2022

We are using the following packages:

"urbanairship-cordova": "14.2.0",
"urbanairship-gimbal-bridge-cordova": "3.1.1",

with auto takeoff by setting the keys in the config.xml. Inside Firebase Crashlytics I see some app crashes (40+) that seems to be caused by this gimbal plugin. It seems to occur when a push has been sent.

Exceptions with stack:

* Fatal Exception: java.lang.RuntimeException
* Unable to start receiver com.urbanairship.gimbal.AirshipReadyReceiver: java.lang.IllegalStateException: Take off must be called before shared()
android.app.ActivityThread.handleReceiver (ActivityThread.java:4238)
android.app.ActivityThread.access$1700 (ActivityThread.java:274)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2113)
android.os.Handler.dispatchMessage (Handler.java:107)
android.os.Looper.loop (Looper.java:237)
android.app.ActivityThread.main (ActivityThread.java:8167)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100) 

* Caused by java.lang.IllegalStateException
* Take off must be called before shared()
com.urbanairship.UAirship.shared (UAirship.java:176)
com.urbanairship.gimbal.AirshipReadyReceiver.onReceive (AirshipReadyReceiver.java:24)
android.app.ActivityThread.handleReceiver (ActivityThread.java:4229)
android.app.ActivityThread.access$1700 (ActivityThread.java:274)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2113)
android.os.Handler.dispatchMessage (Handler.java:107)
android.os.Looper.loop (Looper.java:237)
android.app.ActivityThread.main (ActivityThread.java:8167)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)

Could you please check the implementation if you can find the reason for this?

@rlepinski
Copy link
Contributor

Thanks for the report, we will look into it

@AE1NS
Copy link
Author

AE1NS commented Sep 2, 2022

Do you have any news yet?

@Ulrico972
Copy link
Contributor

Ulrico972 commented Sep 8, 2022

Hello, we'll release a version to fix this in the next days. I'll keep you informed in here.

@Ulrico972
Copy link
Contributor

Hello @AE1NS, the version 3.1.2 is out. Please let us know if everything works for you now.

@AE1NS
Copy link
Author

AE1NS commented Sep 14, 2022

Could not find com.urbanairship.android:gimbal-adapter:7.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/urbanairship/android/gimbal-adapter/7.5.0/gimbal-adapter-7.5.0.pom
       - https://repo.maven.apache.org/maven2/com/urbanairship/android/gimbal-adapter/7.5.0/gimbal-adapter-7.5.0.pom
       - ...

For the previous version this was used, right?:
https://repo.maven.apache.org/maven2/com/urbanairship/android/gimbal-adapter/7.4.0/gimbal-adapter-7.4.0.pom
But for the new version the package is not published:
https://repo.maven.apache.org/maven2/com/urbanairship/android/gimbal-adapter/7.5.0/gimbal-adapter-7.5.0.pom

@Ulrico972
Copy link
Contributor

I'm sorry to hear that. The release process went well so I guess the new version is just experimenting some delay to appear in maven.
And indeed, it wasn't showing up a couple of hours ago but now it does 😄 .

@AE1NS
Copy link
Author

AE1NS commented Sep 15, 2022

Yes, now its working. I will close this issue for now. If we have any more troubles I will reopen it or will create a new one. Thanks for your support!

@AE1NS AE1NS closed this as completed Sep 15, 2022
@AE1NS
Copy link
Author

AE1NS commented Sep 16, 2022

Unfortunately its not running on android now.

"urbanairship-cordova": "14.3.0",
"urbanairship-gimbal-bridge-cordova": "3.1.2",
E/AndroidRuntime: FATAL EXCEPTION: UrbanAirship#1
    Process: de.aeins.obh.mp.app.dev, PID: 20036
    java.lang.IllegalArgumentException: Unable to find component class com.urbanairship.messagecenter.MessageCenter
        at com.urbanairship.UAirship.requireComponent(UAirship.java:1041)
        at com.urbanairship.messagecenter.MessageCenter.shared(MessageCenter.java:99)
        at com.urbanairship.cordova.CordovaAutopilot.onAirshipReady(CordovaAutopilot.java:154)
        at com.urbanairship.UAirship.executeTakeOff(UAirship.java:428)
        at com.urbanairship.UAirship.access$000(UAirship.java:67)
        at com.urbanairship.UAirship$2.run(UAirship.java:381)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
        at com.urbanairship.util.AirshipThreadFactory$1.run(AirshipThreadFactory.java:50)
        at java.lang.Thread.run(Thread.java:1012)

When I downgrade urbanairship-gimbal-bridge-cordova to 3.1.1 its running again.

@AE1NS AE1NS reopened this Sep 16, 2022
@Ulrico972
Copy link
Contributor

My apologies @AE1NS , we didn't update the cordova plugin with our last version yet so I shouldn't have been using the last version.

To avoid you losing anymore time on this until we update Cordova, I would suggest if you mind, to manually update the Airship SDK version to 16.7.2 in your project at platforms/android/urbanairship-cordova/build-extras.gradle.

Does that suits you well ?

@AE1NS
Copy link
Author

AE1NS commented Sep 19, 2022

Unfortunately no. Our build server will overwrite this file after building + synchronizing the capacitor plugins.

Whats the estimated release date of the the version of the urbanairship-cordova plugin?

@Ulrico972
Copy link
Contributor

We should be able to release the next version at least next week. Possibly during this week.

@Ulrico972
Copy link
Contributor

Hi @AE1NS, we released the version 14.4.0 of the urbanairship-cordova plugin today.
This version should fix the versions conflicts you had with the gimbal bridge.
Let us know if there is anything.

@AE1NS
Copy link
Author

AE1NS commented Sep 22, 2022

I will check it, thank you!

@AE1NS AE1NS closed this as completed Sep 22, 2022
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

3 participants