Java 膨胀类com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.SearchView时出错

Java 膨胀类com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.SearchView时出错,java,android,mapbox,Java,Android,Mapbox,正如android文档中的places插件所说,我正在尝试使用带有一些Mapbox功能的AutoCompleteFragment,但我有一个例外,我真的不知道发生了什么。。。我只知道例外情况是: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class com.mapbox.mapboxsdk.plugins.places.autocomplet

正如android文档中的places插件所说,我正在尝试使用带有一些Mapbox功能的AutoCompleteFragment,但我有一个例外,我真的不知道发生了什么。。。我只知道例外情况是:

android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.SearchView
    Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.SearchView
    Caused by: java.lang.reflect.InvocationTargetException
xml文件的一部分:

  <androidx.cardview.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/card_view"
        android:layout_width="0dp"
        android:layout_height="50dp"
        android:layout_gravity="center"
        android:layout_marginStart="16dp"
        android:layout_marginLeft="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginBottom="23dp"
        card_view:cardCornerRadius="4dp"
        card_view:layout_constraintBottom_toTopOf="@+id/textView2"
        card_view:layout_constraintEnd_toEndOf="parent"
        card_view:layout_constraintHorizontal_bias="0.47"
        card_view:layout_constraintStart_toStartOf="parent">

        <fragment
            android:id="@+id/autocomplete_fragment"
            android:name="com.google.android.libraries.places.widget.AutocompleteSupportFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:layout="@layout/places_autocomplete_fragment" />
    </androidx.cardview.widget.CardView>
我只是想运行这个应用程序

PlaceAutocompleteFragment autocompleteFragment;

if (savedInstanceState == null) {
    autocompleteFragment = PlaceAutocompleteFragment.newInstance("Example Token That Isn't in the code");

    final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.autocomplete_fragment, autocompleteFragment,TAG);
    transaction.commit();

} else {
    autocompleteFragment = (PlaceAutocompleteFragment)
            getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment);
}
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
    @Override
    public void onPlaceSelected(CarmenFeature carmenFeature) {
     Geometry geometry = carmenFeature.geometry();
        Toast.makeText(MainActivity.this, carmenFeature.text(), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onCancel() {

    }
});