gpt4 book ai didi

android - XML 错误 : error: not well-formed (invalid token) in splash screen (React Native)

转载 作者:行者123 更新时间:2023-11-29 23:06:57 27 4
gpt4 key购买 nike

我试图在我的 React 应用程序中实现启动画面,但在调试时,启动文件出现错误:错误:格式不正确(无效 token )

<?xml version='1.0' encoding='utf-8' ?>

<layer-list xmlns:='http://schemas.android.com/apk/res/android'>
<item android:drawable='@color/primary' />
<item
android:width='200dp'
android:height='200dp'
android:drawable='@drawable/icon'
android:gravity='center'
/>
</layer-list>

Error Message:

info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
C:\Users\leand\AppTCC\android\app\src\main\res\drawable\background_splash.xml:3: error: not well-formed (invalid token).

最佳答案

改变

<layer-list xmlns:='http://schemas.android.com/apk/res/android'>

<layer-list xmlns:android='http://schemas.android.com/apk/res/android'>

正确定义 android 命名空间前缀并消除错误。

关于android - XML 错误 : error: not well-formed (invalid token) in splash screen (React Native),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56416343/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com