如何解决 Android 资源链接失败错误 (xml/shortcuts) 未找到?

huangapple go评论66阅读模式
英文:

How to solve Android resource linking failed error (xml/shortcuts) not found?

问题

I can provide a translation of the text you provided:

"在模拟器或设备上直接运行应用时,出现以下错误。但生成APK时没有出现问题。已经运行良好,但突然出现了这个问题。

执行任务':app:processPatientDebugResources'失败。

在执行com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction时发生了失败
Android资源链接失败

我尝试更改Kotlin版本,同时在Android Studio选项中无效化缓存,还尝试删除构建文件夹。

执行任务':app:processPatientDebugResources'失败。

在执行com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction时发生了失败
Android资源链接失败
/home/kbytez/project/xxxxxxx/app/build/intermediates/packaged_manifests/patientDebug/AndroidManifest.xml:184: 错误:未找到资源xml/shortcuts(即com.xxxxx.patient:xml/shortcuts)。
/home/kbytez/project/xxxx/app/build/intermediates/packaged_manifests/patientDebug/AndroidManifest.xml:189: 错误:未找到资源string/app_id_value(即com.xxxxx.patient:string/app_id_value)。
错误:处理清单失败。快捷方式可用"

英文:

App showing below error app directly run emulator or device scenario. but generate apk no issue occurred. already working good but suddenly this issue occurred

Execution failed for task ':app:processPatientDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed

i tries change kotlin version and also invalidate caches in android studio option and also try delete build folder

Execution failed for task ':app:processPatientDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
/home/kbytez/project/xxxxxxx/app/build/intermediates/packaged_manifests/patientDebug/AndroidManifest.xml:184: error: resource xml/shortcuts (aka com.xxxxx.patient:xml/shortcuts) not found.
/home/kbytez/project/xxxx/app/build/intermediates/packaged_manifests/patientDebug/AndroidManifest.xml:189: error: resource string/app_id_value (aka com.xxxxx.patient:string/app_id_value) not found.
error: failed processing manifest.shortcut available

答案1

得分: 1

Sure, here is the translated text:

"你想要使用快捷方式吗?如果是的话,请检查是否在res/xml文件夹中有shortcuts.xml文件,以及在你的清单文件中是否有以下代码:

这个代码应该在你的清单文件的<activity>部分中,与以下代码位于同一位置:

如果没有,请检查你的清单文件,并删除上述代码,如果你有的话。"

英文:

And you want to use shortcuts or not? If yes - check if you have shortcuts.xml in res/xml folder and if you have

&lt;meta-data
android:name=&quot;android.app.shortcuts&quot;
android:resource=&quot;@xml/shortcuts&quot; /&gt;

in your manifest file, in &lt;activity&gt; section, the same where you have

 &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;

If not - check your manifest and remove above code, if you have it.

huangapple
  • 本文由 发表于 2023年4月17日 14:46:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76032356.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定