Android Studio-签名和构建APK时,Android资源编译失败

时间:2019-05-11 20:49:15

标签: java android build apk

我最近开始在Android Studio中构建APK(我不太了解),每次尝试构建APK时,都会出现以下错误:

Android resource compilation failed

此后,我进入values.xml并尝试对其进行更改,但它始终会还原。我收到files under the build folder are generated and should not be edited错误。

它也显示unescaped apostrophe in stringerror: not a valid string

有人可以帮助我吗?

我已经尝试过多次验证/清除缓存。重启PC和android studio几次。

由于不允许上传图片,因此出现错误代码:

Android resource compilation failed

C:\Users\runem\Desktop\Android VPN\EasyVPN-Free-master\Android-code\app\build\intermediates\incremental\mergeFreeReleaseResources\merged.dir\values\values.xml:147: error: unescaped apostrophe in string "SideVPN - Created by SyroStudio's. Made with help of EasyVPN".

C:\Users\runem\Desktop\Android VPN\EasyVPN-Free-master\Android-code\app\build\intermediates\incremental\mergeFreeReleaseResources\merged.dir\values\values.xml:147: error: not a valid string.

C:\Users\runem\Desktop\Android VPN\EasyVPN-Free-master\Android-code\app\build\intermediates\incremental\mergeFreeReleaseResources\merged.dir\values\values.xml: error: file failed to compile.
<string name="share_text">SideVPN - Created by SyroStudio's. Made with help of EasyVPN </string>

1 个答案:

答案 0 :(得分:0)

您似乎正在尝试编辑错误的values.xml副本,因为Android Studio会警告您:

  

之后,我进入values.xml并尝试对其进行更改,但它始终会还原。我收到“生成文件夹下的文件已生成且不应进行编辑”的错误。

请确保您从Project导航器中打开文件 ,并且不要通过单击编辑中的错误来打开文件,这可能就是您正在执行的操作。然后,将其替换:

<string name="share_text">SideVPN - Created by SyroStudio's. Made with help of EasyVPN </string>

(请注意{{1}之前的\)。可能这就是您已经在尝试的文件,但是文件格式错误:

'