Android上的Google地图不可见,但徽标是

时间:2018-07-11 21:31:21

标签: android react-native react-native-android react-native-maps

Airbnb的Google Map软件包已经在我的android设备上运行了。现在,我进行了一些更新并安装了新软件包,但现在看不到Google Map了。我只在左下角看到Google徽标。我正在使用react-native 0.54.2和react-native-maps 0.21.0。

android / app / build.gradle

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:27.0.0"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation project(':react-native-onesignal')
    implementation project(':react-native-i18n')
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-image-picker')

    implementation(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }

    implementation project(':react-native-firebase')

    // Firebase dependencies
    implementation "com.google.android.gms:play-services-base:15.0.0"
    implementation "com.google.android.gms:play-services-maps:15.0.0"
    implementation "com.google.firebase:firebase-core:15.0.2"
    implementation "com.google.firebase:firebase-analytics:15.0.2"

}

中的

AndroidManifest.xml

<meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="xxx"/>

MainApplication.java

import com.airbnb.android.react.maps.MapsPackage;

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNFirebasePackage(),
            new RNFirebaseCrashPackage(),
            new RNFirebaseAnalyticsPackage(),
            new ImagePickerPackage(),
            new MapsPackage(),
            new ReactNativeOneSignalPackage(),
            new RNI18nPackage(),
            new SplashScreenReactPackage(),
            new LinearGradientPackage(),
            new RNFetchBlobPackage()
      );
    }

0 个答案:

没有答案