In the content_main.xml file:
<?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>
There was an error:
Cannot resolve symbol 'parent'
FULL LOG:
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
What's the problem with the symbol 'parent'?
In the content_main.xml file:
<?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>
During the process of BUILD, despite the error below(2nd line), the BUILD was successful.
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
And I didn't know where the IllegalArgumentException issue came from.
Anyone can help me ? Thanks!
I think you may be using an old version of ConstraintLayout. Be sure to use a recent version -- beta 4 or newer (We introduced the parent tag support in constraintlayout alpha 5...).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments