简体   繁体   English

谷歌地图没有显示何时从Playstore下载应用程序,但在安装直接签名的apk时显示正常

[英]Google map not showing when app is downloaded from playstore but showing fine when installed directly signed apk

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. 我在谷歌地图面临一个问题。当我从谷歌游戏商店下载apk时,谷歌地图没有显示,但是当我手动安装(通过转移到设备)相同的apk上传到游戏商店时,它工作正常。

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: 在Application节点中:

    <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: 我的java文件说:

@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. 我最近在Google Play商店上传了APK,在查看Play控制台后我遇到了同样的问题我找到了解决此问题的方法。

Their is no problem with your key but the problem is with your SHA-1. 他们的钥匙没问题,但问题在于你的SHA-1。 You signed your APK with your SHA-1 that is fine and then upload the APK it also fine. 你用你的SHA-1签署你的APK很好,然后上传APK也没关系。

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. 但是,根据Play控制台的最新更新,当您使用SHA-1签署APK并上传APK时,它仅由您签名,但根据新的更新,它也会由Google Play签名以获得更高的安全性。 Have a look here some part of Google Play section: 看一下Google Play部分的部分内容:

With Google Play App Signing: You sign your app with your upload key. 使用Google Play应用程序签名:您使用上传密钥对应用进行签名。 Then, Google verifies and removes the upload key signature. 然后,Google会验证并删除上传密钥签名。 Finally, Google re-signs the app with the original app signing key you provided and delivers your app to the user. 最后,Google会使用您提供的原始应用签名密钥重新签名应用,并将您的应用交付给用户。

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 . 现在,您的问题的答案是在成功上传APK之后,您可以看到在第2个SHA-1部分中, 第一个SHA-1是Google自己创建的, 第二个SHA-1是您自己的

So just copy the Google SHA-1 and paste it to your console where you generate the Google Map API Key. 因此,只需复制Google SHA-1并将其粘贴到生成Google Map API密钥的控制台即可。

After a long research about App Signing feature, I came to solution that Google ADDED App Signing feature for app publishing over Google Play. 在对App Signing功能进行了长时间的研究之后,我找到了Google添加应用程序签名功能的解决方案,用于通过Google Play发布应用程序。 This feature is added due to Keystore mismatch/lost issue faced by all client/developer. 由于所有客户端/开发人员面临密钥库不匹配/丢失问题,因此添加了此功能。

Generally, in new Update of Google Play Developer Console when we upload any apk file over Google Developer , it default provide the service of app signing by Google-Play Self istead Development/Release Keystore has been lost User can update app with new certificate. 通常,在Google Play开发者控制台的新更新中,当我们通过Google Developer上传任何apk文件时,默认情况下会提供Google-Play自定义应用程序签名服务istead开发/发布密钥库已丢失用户可以使用新证书更新应用程序。

App signing key : The key used to sign the APK that's on a user's device. 应用程序签名密钥 :用于对用户设备上的APK进行签名的密钥。 You currently hold the app signing key and use it to sign your APKs. 您目前持有应用签名密钥并使用它来为您的APK签名。 When you complete the program sign-up flow you will upload this key to Google. 完成程序注册流程后,您将把此密钥上传到Google。

Upload key : A new key you generate during your enrollment in the program. 上传密钥 :您在注册该计划期间生成的新密钥。 You will use the upload key to sign all future APKs prior to uploading them to the Play Console. 在将所有APK上传到Play控制台之前,您将使用上传密钥对所有未来的APK进行签名。

So if you accept the App Signing feature during app publishing, then On Google Console you have to provide the Google's App Signing Key SHA-1 key instead of Your uploaded certificate key. 因此,如果您在应用发布期间接受应用签名功能,那么在Google控制台上,您必须提供Google的应用签名密钥SHA-1密钥,而不是您上传的证书密钥。 So just change it with App Signing SHA-1 Certificate. 所以只需使用App Signing SHA-1证书进行更改即可。

You can find App Signing Certificate SHA-1 key from below Tabs. 您可以从下面的选项卡中找到应用程序签名证书SHA-1密钥。

Google Play Developer Console > Dashboard > Release Management > App Signing . Google Play开发者控制台>信息中心>版本管理>应用程序签名

This is SHA1 key issue .check your google console fingerprint SHA1 thats in release.if your key in debug thats not work in playstore App. 这是SHA1密钥问题。检查你的google控制台指纹SHA1即发布。如果你的调试密钥在playstore App中不起作用。

A debug certificate : The Android SDK tools generate this certificate automatically when you do a debug build. 调试证书 :Android SDK工具在您进行调试构建时自动生成此证书。 Only use this certificate with apps that you're testing. 仅将此证书与您正在测试的应用程序一起使用。 Do not attempt to publish an app that's signed with a debug certificate. 请勿尝试发布使用调试证书签名的应用程序。 The debug certificate is described in more detail in Signing in Debug Mode in the Android Developer Documentation. 调试证书在Android Developer Documentation中的Signing in Debug Mode中有更详细的描述。

A release certificate: The Android SDK tools generate this certificate when you do a release build. 发布证书: Android SDK工具在您执行发布版本时生成此证书。 You can also generate this certificate using the keytool program. 您还可以使用keytool程序生成此证书。 Use this certificate when you are ready to release your app to the world. 准备好向全世界发布应用程序时使用此证书。

For More Details Refer Get API Key and app's SHA-1 fingerprint 有关详细信息,请参阅获取API密钥应用程序的SHA-1指纹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从playstore下载时,签名的APK崩溃 - signed apk crashing when downloaded from playstore 使Google签名的APK无法显示Google地图 - Google map not showing when make signed apk 从 Google PlayStore 下载时应用程序关闭与发布 apk 一起使用 - App closes when downloaded from Google PlayStore work with release apk 从Playstore安装的应用中未显示地图 - Map is not showing in app installed from playstore 发布到PlayStore时,Google Map API无法显示在应用中 - Google map api not showing in app when published to playstore 未显示带有签名APK的Google Map - Google Map not showing with signed APK 从Android Studio运行时,应用正常运行,但在安装签名的APK后崩溃 - App works fine when running from Android Studio but crashes when signed apk installed 当应用程序已从 Playstore 安装时无法安装 apk - Cannot install apk when the app is already installed from Playstore 直接从 Android Studio 测试时,应用程序运行良好,但在设备上作为 APK 安装时则不行 - App works fine, when testing directly from Android Studio, but not when installed as APK on the Device 发布后搜寻时,应用程式未显示在Google Play商店中 - App not showing on google playstore when you searched after published
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM