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

Incorrect cast of Context in InstructionView #953

Closed
dh06IRL opened this issue May 18, 2018 · 3 comments
Closed

Incorrect cast of Context in InstructionView #953

dh06IRL opened this issue May 18, 2018 · 3 comments
Labels
bug Defect to be fixed.

Comments

@dh06IRL
Copy link

dh06IRL commented May 18, 2018

Android API: Android P
Mapbox Navigation SDK version: 0.13.0

Steps to trigger behavior

  1. Utilize InstructionView in v4 Fragment or AppCompatActivity
  2. Attempt to inflate layout
  3. Crash Thrown

Actual behavior

java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.support.v4.app.FragmentActivity
       at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView.addBottomSheetListener(InstructionView.java:554)
       at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView.onAttachedToWindow(InstructionView.java:143)
       at android.view.View.dispatchAttachedToWindow(View.java:18345)
       at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
       at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
       at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
       at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
       at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
       at android.view.Choreographer.doCallbacks(Choreographer.java:747)
       at android.view.Choreographer.doFrame(Choreographer.java:682)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6649)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
@danesfeder
Copy link
Contributor

Hey @dhodge229 thanks for bringing this to us - just to confirm, you are using only the InstructionView in a layout (in either v4 Fragment or AppCompatActivity). Do you mind letting us know which version of the support library you are using as well? Thanks!

@dh06IRL
Copy link
Author

dh06IRL commented May 18, 2018

Currently using 27.1.1 for all support libs.

@danesfeder
Copy link
Contributor

@dhodge229 I attacked this issue from a few different angles in #973. Should address this crash you were seeing - thanks for checking out the SDK!

@danesfeder danesfeder mentioned this issue Jun 21, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

No branches or pull requests

4 participants