通过深度链接多次打开 Uber 应用程序崩溃

Uber app crash when opened via deeplink multiple times

目前我正致力于从 cordova 应用程序深度链接到 Uber 应用程序。 深层链接在较新的手机上按预期工作,但在 android 6.0 上,当深层链接被调用两次时优步崩溃。

使用了以下深层链接 url:

https://m.uber.com/ul/?action=setPickup&client_id=8AV0mBPupgZsue2ghtFfmd9sFV2wuNOg&pickup[formatted_address]=Rotterdam%20Centraal%20Station%2C%20Stationsplein%2C%20Rotterdam%2C%20Netherlands&pickup[latitude]=51.923674&pickup[longitude]=4.470496&dropoff[formatted_address]=Kinderhuissingel%2C%20Haarlem%2C%20Netherlands&dropoff[latitude]=52.386614&dropoff[longitude]=4.630431

重现错误的步骤如下(Android 6.0):

  1. 从 cordova 应用打开深层链接
  2. 等待优步开门
  3. 按两次后退按钮返回 cordova 应用程序
  4. 从 cordova 应用程序按 deeplink agian
  5. 优步崩溃并出现以下错误:

    02-19 09:38:41.056 18250-18250/? E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.ubercab, PID: 18250
       io.reactivex.exceptions.CompositeException: 1 exceptions occurred. 
           at com.ubercab.rx2.java.CrashOnErrorConsumer.onError(SourceFile:136)
           at com.ubercab.rx2.java.CrashOnErrorConsumer.onNext(SourceFile:115)
           at com.uber.autodispose.HalfSerializer.a(SourceFile:129)
           at com.uber.autodispose.AutoDisposingObserverImpl.onNext(SourceFile:79)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.e(SourceFile:200)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(SourceFile:252)
           at io.reactivex.android.FastPathScheduler$ScheduledRunnable.run(SourceFile:180)
           at android.os.Handler.handleCallback(Handler.java:739)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:135)
           at android.app.ActivityThread.main(ActivityThread.java:5343)
           at java.lang.reflect.Method.invoke(Native Method)
           at java.lang.reflect.Method.invoke(Method.java:372)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
         ComposedException 1 :
        io.reactivex.exceptions.OnErrorNotImplementedException: arom
           at com.ubercab.rx2.java.CrashOnErrorConsumer.onError(SourceFile:136)
           at com.ubercab.rx2.java.CrashOnErrorConsumer.onNext(SourceFile:115)
           at com.uber.autodispose.HalfSerializer.a(SourceFile:129)
           at com.uber.autodispose.AutoDisposingObserverImpl.onNext(SourceFile:79)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.e(SourceFile:200)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(SourceFile:252)
           at io.reactivex.android.FastPathScheduler$ScheduledRunnable.run(SourceFile:180)
           at android.os.Handler.handleCallback(Handler.java:739)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:135)
           at android.app.ActivityThread.main(ActivityThread.java:5343)
           at java.lang.reflect.Method.invoke(Native Method)
           at java.lang.reflect.Method.invoke(Method.java:372)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
        Caused by: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
           at jom.c(SourceFile:26)
           at arpl.a(SourceFile:137)
           at aroj.c(SourceFile:422)
           at aroj.a(SourceFile:388)
           at arom.a(Unknown Source)
           at com.ubercab.rx2.java.CrashOnErrorConsumer.a(SourceFile:69)
           at com.ubercab.rx2.java.CrashOnErrorConsumer.onNext(SourceFile:112)
           at com.uber.autodispose.HalfSerializer.a(SourceFile:129)
           at com.uber.autodispose.AutoDisposingObserverImpl.onNext(SourceFile:79)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.e(SourceFile:200)
           at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(SourceFile:252)
           at io.reactivex.android.FastPathScheduler$ScheduledRunnable.run(SourceFile:180)
           at android.os.Handler.handleCallback(Handler.java:739)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:135)
           at android.app.ActivityThread.main(ActivityThread.java:5343)
           at java.lang.reflect.Method.invoke(Native Method)
           at java.lang.reflect.Method.invoke(Method.java:372)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

谁能帮忙解决这个问题?

问题特定于在 android 6.0 及更低版本上使用通用链接。 通过切换到深度链接 (uber://) 解决了问题。