mapbox / mapbox/mapbox-navigation-android

Error inflating class SummaryBottomSheet

Open
#4,269 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug jira-sync-complete
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

I add this in my layout

> android:id="@+id/summaryBottomSheet"
> android:layout_width="match_parent"
> android:layout_height="wrap_content"
> android:visibility="gone"
> app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />


show the layout on the Second screen
```
public MyPresentation extends Presentation{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setCanceledOnTouchOutside(false);
setContentView(R.layout.my_layout);
}
```
Then I run app and get error

**Android API:**
**Mapbox Navigation SDK version:1.4.0**

Caused by: android.view.InflateException: Binary XML file line #7 in com.example.carbittest:layout/mapbox_summary_bottomsheet: Binary XML file line #23 in com.example.carbittest:layout/mapbox_partial_summary_peek: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #23 in com.example.carbittest:layout/mapbox_partial_summary_peek: Error inflating class
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:854)
at android.view.LayoutInflater.createView(LayoutInflater.java:776)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:930)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:950)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1263)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1119)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1263)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1119)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)

I found the error when use this layout content, landscape screen, it need to getDrawable() and it is null, so the app crash.
```

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced mapbox_summary_bottomsheet and mapbox_partial_summary_peek layouts, then inspect the ImageView using @drawable/mapbox_ic_circle_black. Reproduce inflation on a landscape screen and trace why getDrawable() is null. Done means the layout inflates without crashing in that configuration and the divider drawable is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.