处理清单失败的Android Studio

时间:2018-11-10 16:52:54

标签: android-studio manifest

我在android studio中运行项目时遇到了一个问题,它引发了一个错误。我知道的其实不多,但这是完整的错误:

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.jar\400d656be4460564aa03c7fb5fa4f8bf\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

它发生了https://wiki.eclipse.org/Eclipse.ini。 请帮忙!

1 个答案:

答案 0 :(得分:2)

您的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密钥。