谷歌地图不显示应用程序何时从Playstore下载,但直接安装apk后显示效果不错 [英] Google map not showing when app is downloaded from playstore but showing fine when installed directly signed apk

查看:114
本文介绍了谷歌地图不显示应用程序何时从Playstore下载,但直接安装apk后显示效果不错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌地图中遇到了一个问题。当我从谷歌播放商店下载apk时,谷歌地图没有显示,但当我手动安装(通过转移到设备)相同的apk上传到游戏商店时,它工作正常。 / p>

我重新检查了我的调试和释放键,它们是这里



请在清单文件中找到权限:

 < uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION/> 
< uses-permission android:name =android.permission.ACCESS_NETWORK_STATE/>
< uses-permission android:name =android.permission.USE_FINGERPRINT/>
< uses-permission android:name =android.permission.INTERNET/>
< uses-permission android:name =android.permission.ACCESS_FINE_LOCATION/>
<使用权限android:name =android.permission.READ_EXTERNAL_STORAGE/>
< uses-permission android:name =android.permission.WRITE_EXTERNAL_STORAGE/>
< uses-permission android:name =android.permission.GET_TASKS/>
< uses-permission android:name =android.permission.CALL_PHONE/>
<使用权限android:name =android.permission.ACCESS_WIFI_STATE/>
<使用权限android:name =com.google.android.providers.gsf.permission.READ_GSERVICES/>

< uses-feature
android:glEsVersion =0x00020000
android:required =true/>

在应用程序节点中:

<$ p $ < code>< meta-data
android:name =com.google.android.gms.version
android:value =@ integer / google_play_services_version/>
< meta-data
android:name =com.google.android.geo.API_KEY
android:value =@ string / google_maps_key/>

和我的java文件说:

  @Override 
public void onMapReady(GoogleMap googleMap){

try {

map = googleMap;
//它会在地图上隐藏导航和gps指针按钮
map.getUiSettings()。setMapToolbarEnabled(false);
// map.getUiSettings()。setZoomControlsEnabled(false);如果(!PermissionUtil())获取公司详细信息()。getResponseDetail()。getCompanyDetail()。getLatitude())){

$ b if(TextUtils.isEmpty(companyDetailModel.getSupplierCompanyDetailsRS .checkPermission(getActivity(),Manifest.permission.ACCESS_FINE_LOCATION)){

PermissionUtil.requestPermission(getActivity(),android.Manifest.permission.ACCESS_FINE_LOCATION,LOCATION_PERMISSION_CODE);

} else {
map.setMyLocationEnabled(true);

GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener(){
@Override
public void onMyLocationChange(Location location){
LatLng loc = new LatLng(location。 getLatitude(),location.getLongitude());
map.animateCamera(CameraUpdateFactory.newLatLngZoom(loc,16.0f));
}
};
map.setOnMyLocationChangeListener(myLocationChangeListener);



$ b} else {

LatLng latLng = new LatLng(Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS()。getResponseDetail ).getCompanyDetail()。getLatitude()),Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS()。getResponseDetail()。getCompanyDetail()。getLongitude()));
map.addMarker(new MarkerOptions()。position(latLng)/ *。title(+ companyDetailModel.getSupplierCompanyDetailsRS()。getResponseDetail()。getCompanyDetail()。getAddress())/ *。icon(BitmapDescriptorFactory。 fromResource(R.drawable.icon_launcher))* /);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,14.0f));


$ b map.setOnMapClickListener(new GoogleMap.OnMapClickListener(){
@Override
public void onMapClick(LatLng latLng){
showFullScreenMap();
}
});

} catch(Exception e){
Log.i(LatLng exception,+ e);
Utils.showToast(getActivity(),+ e);
}

}


解决方案

我最近在Google Play商店上传APK,并在检查Play Console后遇到同样的问题,我找到了解决此问题的解决方案。

他们没有问题用你的钥匙,但问题在于你的SHA-1。您已经使用您的SHA-1签署了您的APK并且没问题,然后将APK也上传。



但是,当您在APK上签名时,使用SHA-1并上传仅由您签名的APK,但根据最新更新,它还由Google Play签名以提高安全性。查看Google Play部分内容:


使用Google Play应用签名:您可以使用上传密钥为应用签名。
然后,Google会验证并移除上传密钥签名。最后,
Google会使用您提供
的原始应用签名密钥重新签署该应用,并将您的应用交付给用户。


您可以在这里参阅文档



现在,您的问题的答案是成功上传APK之后,您可以看到在带有两个SHA-1的部分中,第一个SHA-1是Google创建的它自己的和第二个SHA-1是你的

所以,只需复制Google SHA-1并将其粘贴到您的控制台,生成Google Map API密钥。


I am facing an issue in google map.Google map is not showing when I download the apk from google play store but it works fine when I manually install(by transferring to device) same apk which was uploaded to play store.

I have rechecked my debug and release keys which are present here

Please find permission in manifest file:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

And in Application node:

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />

and my java file says:

@Override
public void onMapReady(GoogleMap googleMap) {

    try {

        map = googleMap;
        // it will hide navigation and gps pointer buttons on map
        map.getUiSettings().setMapToolbarEnabled(false);
        //            map.getUiSettings().setZoomControlsEnabled(false);

        if (TextUtils.isEmpty(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLatitude())) {


            if (!PermissionUtil.checkPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)) {

                PermissionUtil.requestPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION, LOCATION_PERMISSION_CODE);

            } else {
                map.setMyLocationEnabled(true);

                GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener() {
                    @Override
                    public void onMyLocationChange(Location location) {
                        LatLng loc = new LatLng(location.getLatitude(), location.getLongitude());
                        map.animateCamera(CameraUpdateFactory.newLatLngZoom(loc, 16.0f));
                    }
                };
                map.setOnMyLocationChangeListener(myLocationChangeListener);

            }


        } else {

            LatLng latLng = new LatLng(Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLatitude()), Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLongitude()));
            map.addMarker(new MarkerOptions().position(latLng)/*.title("" + companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getAddress())/*.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_launcher))*/);
            map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14.0f));
        }


        map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
            @Override
            public void onMapClick(LatLng latLng) {
                showFullScreenMap();
            }
        });

    } catch (Exception e) {
        Log.i("LatLng exception", "" + e);
        Utils.showToast(getActivity(), "" + e);
    }

}

解决方案

I recently Upload the APK on Google Play store and I faced the same issue after checking the Play Console I found the solution for this problem.

Their is no problem with your key but the problem is with your SHA-1. You signed your APK with your SHA-1 that is fine and then upload the APK it also fine.

But as per the new update for Play Console when you signed your APK with SHA-1 and upload the APK it only signed by you but as per the new update it is also signed by Google Play for more security. Have a look here some part of Google Play section:

With Google Play App Signing: You sign your app with your upload key. Then, Google verifies and removes the upload key signature. Finally, Google re-signs the app with the original app signing key you provided and delivers your app to the user.

You can refer Documentation here.

Now, The Answer of your question is After successfully upload the APK you can see that in the section with Two SHA-1 the 1st SHA-1 is Google created its own and 2nd SHA-1 is its yours.

So just copy the Google SHA-1 and paste it to your console where you generate the Google Map API Key.

这篇关于谷歌地图不显示应用程序何时从Playstore下载,但直接安装apk后显示效果不错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆