[英]Getting Error java.lang.IllegalArgumentException: unexpected url
[英]Error:java.lang.IllegalArgumentException: Unexpected type tag 67 found
在content_main.xml文件中:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main"
tools:context="com.waylanpunch.event.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
有一个错误:
Cannot resolve symbol 'parent'
完整日志:
Information:Gradle tasks [:app:assembleDebug]
D:\WORKGROUP\WORKSPACES\Android_Studio_WORKSPACE\Event\app\src\main\res\layout\content_main.xml
Error:(16, 49) String types not allowed (at 'layout_constraintBottom_toBottomOf' with value 'parent').
Error:(17, 45) String types not allowed (at 'layout_constraintLeft_toLeftOf' with value 'parent').
Error:(18, 47) String types not allowed (at 'layout_constraintRight_toRightOf' with value 'parent').
Error:(19, 43) String types not allowed (at 'layout_constraintTop_toTopOf' with value 'parent').
D:\WORKGROUP\WORKSPACES\Android_Studio_WORKSPACE\Event\app\build\intermediates\res\merged\debug\layout\content_main.xml
Error:(16, 49) String types not allowed (at 'layout_constraintBottom_toBottomOf' with value 'parent').
Error:(17, 45) String types not allowed (at 'layout_constraintLeft_toLeftOf' with value 'parent').
Error:(18, 47) String types not allowed (at 'layout_constraintRight_toRightOf' with value 'parent').
Error:(19, 43) String types not allowed (at 'layout_constraintTop_toTopOf' with value 'parent').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 1.786 secs
Information:9 errors
Information:0 warnings
Information:See complete output in console
符号“父母”有什么问题?
在content_main.xml文件中:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main"
tools:context="com.waylanpunch.event.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Hello World!" />
</FrameLayout>
在BUILD的过程中,尽管出现了下面的错误(第 2 行),但BUILD是成功的。
Information:Gradle tasks [:app:generateDebugSources,:app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Error:java.lang.IllegalArgumentException: Unexpected type tag 67 found.
Information:BUILD SUCCESSFUL
Information:Total time: 2.523 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
而且我不知道IllegalArgumentException问题从何而来。
任何人都可以帮助我吗? 谢谢!
我认为您可能正在使用旧版本的 ConstraintLayout。 请务必使用最新版本——beta 4 或更新版本(我们在constraintlayout alpha 5 中引入了父标签支持...)。
我可以通过重新启动 Android Studio 来解决类似的问题。
这是我的条件。 我对 .java 文件而不是 .xml 文件做了一些更改然后突然当我构建项目时,我总是收到以下消息
Error:java.lang.IllegalArgumentException: Unexpected type tag 67 found.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.