SupportMapFragment does not support AndroidX Fragment

后端 未结 10 1605
傲寒
傲寒 2020-11-30 11:04
import com.google.android.gms.maps.SupportMapFragment;
import androidx.fragment.Fragment;
...
private SupportMapFragment mMapFragment;
...
mMapFragment = (SupportMap         


        
10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 11:33

    I had your same problem, fixed by updating all imports to the last version available in the build.gradle file and adding

    android.enableJetifier=true
    android.useAndroidX=true
    

    To the gradle.properties

    this is the version of the maps package I imported

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    

    You just have to fix some imports and then you're done

    I hope

    EDIT: even after editing what i just said, you will still have the error shown in the java but it compiles and runs without errors

    EDIT2: yesterday they suggested a workaround on the issuetracker https://issuetracker.google.com/issues/110573930#comment13

提交回复
热议问题