处理清单失败 android studio

Processing manifest failed android studio

我在 android 工作室中遇到问题,我在其中 运行 项目并引发错误。我知道的不多,但这是完整的错误:

Android resource linking failed
Output:  C:\Users\John\AndroidStudioProjects\MyApplication\app\build\intermediates\instant_run_merged_manifests\debug\processDebugManifest\instant-run\AndroidManifest.xml:44: error: resource string/google_maps_key (aka com.example.john.myapplication:string/google_maps_key) not found.
error: failed processing manifest.

Command: C:\Users\John\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar0d656be4460564aa03c7fb5fa4f8bf\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
        C:\Users\John\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
        -I\
        C:\Users\John\AndroidStudioProjects\MyApplication\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        --manifest\
        C:\Users\John\AndroidStudioProjects\MyApplication\app\build\intermediates\instant_run_merged_manifests\debug\processDebugManifest\instant-run\AndroidManifest.xml\
        -o\
        C:\Users\John\AndroidStudioProjects\MyApplication\app\build\intermediates\instant_run_main_apk_resources\debug\instantRunMainApkResourcesDebug\out\main_resources\resources_ap\
        --auto-add-overlay\
        -0\
        apk\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

发生了 here。 请帮忙!

您的 Android 清单中可能有这样的内容:

meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="@string/google_maps_key"

您需要将该字符串添加到您的 app/src/main/res/values/strings.xml 文件中:

<resources>
    <string name="google_maps_key"> COPY THE VALUE FROM GOOGLE CLOUD PLATFORM </string>
</resources>

您可以关注this tutorial获取API密钥。