有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java发布密钥无法与部署的应用程序一起使用

我使用youtube上的视频教程创建了一个发布密钥,不幸的是,我在部署之前创建的发布密钥没有。扩大当在谷歌云平台上查看限制我的应用的密钥时,他们需要。密钥库扩展。但是安卓的发布密钥创建教程有一个。jks分机。当我的应用程序拒绝显示谷歌地图,facebook登录也无法工作时,扩展真的很重要吗?下面你可以看到我的安卓清单和模块应用

不过,我已经向谷歌play商店发送了一封邮件,要求更改我的发布密钥(使用扩展名为.jks的安卓教程),但至今仍未收到回复

以下是我为寻求帮助而查看的一些链接

(教程) https://www.youtube.com/watch?v=AWawL5HFn64

Release APK file not showing google maps

https://developer.安卓.com/studio/publish/app-signing#generate-key

建造。gradle(模块:应用程序)

apply plugin: 'com.安卓.application'
安卓 {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.readygo.showmoney"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 7
        versionName "1.0.5"
        testInstrumentationRunner "安卓.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude '.readme'
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/res/avataruni'] } }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.安卓.support:appcompat-v7:28.0.0'
    implementation 'com.安卓.support.constraint:constraint-layout:2.0.0-beta2'
    implementation 'com.google.安卓.gms:play-services-maps:17.0.0'
    implementation 'com.安卓.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.13-beta-3'
    安卓TestImplementation 'com.安卓.support.test:runner:1.0.2'
    安卓TestImplementation 'com.安卓.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.安卓.support:cardview-v7:28.0.0'
    implementation 'com.kaopiz:kprogresshud:1.1.0'
    implementation 'com.wrapp.floatlabelededittext:library:0.0.6'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'com.github.fuzz-productions:RatingBar:1.0.3'
    implementation 'com.安卓.support:design:28.0.0'
    implementation 'com.github.florent37:singledateandtimepicker:2.0.4'
    implementation 'com.github.dmytrodanylyk.shadow-layout:library:1.0.3'
    implementation 'com.zcw:togglebutton-library:1.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
    implementation 'com.google.安卓.gms:play-services-location:17.0.0'

    //implementation 'com.google.安卓.gms:play-services-places:17.0.0'
    implementation 'com.google.安卓.libraries.places:places:2.0.0'

    implementation 'com.安卓.support:recyclerview-v7:28.0.0'

    // Firebase
    implementation 'com.google.安卓.gms:play-services-auth:17.0.0'

    //facebook
    implementation 'com.facebook.安卓:facebook-login:[5,6)'

    // volley plus
    // implementation 'dev.dworks.libs:volleyplus:0.1.4'

    // retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.6.0'

    // okhttp
    implementation 'com.squareup.okhttp3:okhttp:4.0.1'

    // gson
    implementation 'com.google.code.gson:gson:2.8.5'

    // permission manager
    implementation 'com.karumi:dexter:5.0.0'

    // date management
    implementation 'net.danlew:安卓.joda:2.10.2'

    //apache common util
    implementation 'org.apache.commons:commons-collections4:4.4'

    //smart-location-lib
    implementation 'io.nlopez.smartlocation:library:3.3.3'

    //dialog progress bar
    implementation 'com.github.d-max:spots-dialog:1.1@aar'

    //pushy
    implementation 'me.pushy:sdk:1.0.43'

    //multi dex
    implementation 'com.安卓.support:multidex:1.0.3'

    //string manipulation
    implementation 'org.apache.commons:commons-lang3:3.9'

    // exit interface
    implementation "com.安卓.support:exifinterface:28.0.0"

    //custom tabs
    implementation "com.安卓.support:customtabs:28.0.0"

}
apply plugin: 'com.google.gms.google-services'

AndroidManifest。xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
    xmlns:tools="http://schemas.安卓.com/tools"
    package="com.readygo.showmoney">

    <uses-permission 安卓:name="安卓.permission.INTERNET" />
    <uses-permission 安卓:name="安卓.permission.ACCESS_NETWORK_STATE" />

    <uses-feature 安卓:name="安卓.hardware.camera" />

    <uses-permission 安卓:name="安卓.permission.GET_ACCOUNTS" />
    <uses-permission 安卓:name="安卓.permission.CAMERA" />
    <uses-permission 安卓:name="安卓.hardware.camera.autofocus" />
    <uses-permission 安卓:name="安卓.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission 安卓:name="安卓.permission.VIBRATE" />
    <uses-permission 安卓:name="安卓.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission 安卓:name="安卓.permission.ACCESS_FINE_LOCATION" />
    <uses-permission 安卓:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
    <uses-permission 安卓:name="安卓.permission.GET_TASKS" />
    <uses-permission 安卓:name="安卓.permission.READ_EXTERNAL_STORAGE" />

    <uses-feature 安卓:name="安卓.hardware.location.gps" />

    <uses-permission 安卓:name="安卓.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission 安卓:name="安卓.permission.WAKE_LOCK" />
    <uses-permission 安卓:name="安卓.permission.USE_CREDENTIALS" />
    <uses-permission 安卓:name="安卓.permission.READ_PHONE_STATE" />
    <uses-permission 安卓:name="安卓.permission.READ_CONTACTS" />

    <application
        安卓:name=".app.AppController"
        安卓:allowBackup="true"
        安卓:icon="@mipmap/ic_launcher"
        安卓:label="@string/app_name"
        安卓:roundIcon="@mipmap/ic_launcher_round"
        安卓:supportsRtl="true"
        安卓:theme="@style/AppTheme">
        <activity 安卓:name=".activities.Act_Shop_Billing"></activity>
        <activity
            安卓:name=".activities.ShopSearchActivity"
            安卓:windowSoftInputMode="stateHidden" />
        <activity 安卓:name=".activities.Act_Main_Rating" />
        <activity 安卓:name=".activities.Create_Update_Holiday_Break" />
        <activity 安卓:name=".activities.CreateAppointment" />
        <activity
            安卓:name=".activities.Act_Splash"
            安卓:screenOrientation="portrait"
            安卓:theme="@style/FullScreen">
            <intent-filter>
                <action 安卓:name="安卓.intent.action.MAIN" />

                <category 安卓:name="安卓.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data 安卓:name="com.facebook.sdk.ApplicationId"
            安卓:value="@string/facebook_app_id"/>

        <activity 安卓:name="com.facebook.FacebookActivity"
            安卓:configChanges=
                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            安卓:label="@string/app_name" />
        <activity
            安卓:name="com.facebook.CustomTabActivity"
            安卓:exported="true">
            <intent-filter>
                <action 安卓:name="安卓.intent.action.VIEW" />
                <category 安卓:name="安卓.intent.category.DEFAULT" />
                <category 安卓:name="安卓.intent.category.BROWSABLE" />
                <data 安卓:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>

        <activity
            安卓:name=".activities.Act_Login_Option"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Login"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.SendEmailActivity"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Reg_Customer"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Reg_Barbers"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Home_Cust"
            安卓:screenOrientation="portrait" />
        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/. 
        -->
        <meta-data
            安卓:name="com.google.安卓.geo.API_KEY"
            安卓:value="@string/google_maps_key" />

        <activity
            安卓:name=".activities.Act_Maps"
            安卓:label="@string/title_activity_maps" />

        <service
            安卓:name=".service.GpsService"
            安卓:enabled="true" />

        <activity
            安卓:name=".activities.SelectBookDateActivity"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Choose_Photo"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.OpeningHoursActivity"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_DayTime_Choice"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Add_Service"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Add_Barber"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Home_Barber"
            安卓:screenOrientation="portrait" />
        <activity
            安卓:name=".activities.Act_Upload_Profile_Picture"
            安卓:screenOrientation="portrait" />

        <activity 安卓:name=".activities.Act_Barber_Shop_Services" />
        <activity 安卓:name=".activities.Act_BookingHistory_BarberShop" />
        <activity 安卓:name=".activities.UpcomingBarberShopBookingActivity" /> <!-- Pushy Declarations -->
        <!-- Pushy Notification Receiver -->
        <!-- Incoming push notifications will invoke the following BroadcastReceiver -->
        <receiver
            安卓:name=".activities.PushReceiver"
            安卓:exported="false">
            <intent-filter>

                <!-- Do not modify this -->
                <action 安卓:name="pushy.me" />
            </intent-filter>
        </receiver> <!-- Pushy Update Receiver -->
        <!-- Do not modify - internal BroadcastReceiver that restarts the listener service -->
        <receiver
            安卓:name="me.pushy.sdk.receivers.PushyUpdateReceiver"
            安卓:exported="false">
            <intent-filter>
                <action 安卓:name="安卓.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver> <!-- Pushy Boot Receiver -->
        <!-- Do not modify - internal BroadcastReceiver that restarts the listener service -->
        <receiver
            安卓:name="me.pushy.sdk.receivers.PushyBootReceiver"
            安卓:exported="false">
            <intent-filter>
                <action 安卓:name="安卓.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver> <!-- Pushy Socket Service -->
        <!-- Do not modify - internal service -->
        <service 安卓:name="me.pushy.sdk.services.PushySocketService" /> <!-- Pushy Job Service (added in Pushy SDK 1.0.35) -->
        <!-- Do not modify - internal service -->
        <service
            安卓:name="me.pushy.sdk.services.PushyJobService"
            安卓:exported="true"
            安卓:permission="安卓.permission.BIND_JOB_SERVICE" />
        <uses-library
            安卓:name="org.apache.http.legacy"
            安卓:required="false" />
    </application>

</manifest>

对于谷歌地图,它显示一个完全空白的屏幕,没有标记或地图显示

facebook登录时会显示消息“登录错误:您登录此应用程序时出错。请稍后再试”。尽管出现错误消息,我还是能够获取哈希键,并将其直接添加到facebook开发者网站,但仍然无法工作


共 (1) 个答案

  1. # 1 楼答案

    首先,将其添加到构建中。gradle应用程序模块

    android {
        signingConfigs {
            release {
                keyAlias 'XXXXX'
                keyPassword 'XXXXX'
                storeFile file('../keystore/XXXXX') // Add in project_directory/keystore/ don't worry about extention
                storePassword 'XXXXX'
            }
    
    buildTypes {
            release {
                signingConfig signingConfigs.release 
            }
            debug {}
        }
       ...
        }
    

    然后跟着this

    在获得相关指纹后,像施咒一样将其添加到谷歌或Facebook上