With the following syntax
Android resource compilation failed
C: \ Users \ Administrator \ AndroidStudioProjects \ HelloWorld \ app \ src \ main \ res \ layout \ activity_main.xml: 15: AAPT: error: junk after document element.
C: \ Users \ Administrator \ AndroidStudioProjects \ HelloWorld \ app \ src \ main \ res \ layout \ activity_main.xml: AAPT: error: file failed to compile.
Error is displayed.
How can I fix it?
<? xml version = "1.0" encoding = "utf-8"?> <EditText android: id = "@ + id/etinput" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: layout_marginBottom = "25dp" android: lauyout_marginTop = "5dp" android: background = "# ffffff" android: inputType = "text" /> <ConstraintLayout android: layout_width = "match_parent" android: layout_height = "wrap_content" android: background = "# df7401" android: orientation = "horizontal"> <CheckBox android: id = "@ + id/cbDrink" android: layout_width = "wrap_content" android: layout_heigt = "wrap_content" android: layout_marginRight = "25dp" android: background = "# ffffff" android: text = "@ string/cb_drink" /> <CheckBox android: id = "@ + id/cbFood" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "@ string/cb_food" /> </ConstraintLayout> <Button android: id = "@ + id/btSave" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "@ string/bt_save" tools: layout_editor_absoluteX = "-7dp" tools: layout_editor_absoluteY = "66dp" /> </androidx.constraintlayout.widget.ConstraintLayout>
Answer # 1
If you are using ConstraintLayout, you must constrain the child elements.
You need to specify the following code for each View.
app: layout_constraintStart_toStartOf = "parent" app: layout_constraintEnd_toEndOf = "parent" app: layout_constraintTop_toTopOf = "parent" app: layout_constraintBottom_toBottomOf = "parent"
If the layout doesn't have to be particularly complicated, use ConstraintLayout.
LinearLayoutIf you change to, you can change the layout to vertical or horizontal layout.
Reference URL: https://techacademy.jp/magazine/4455
Answer # 2
If it is not a typo, the last is "
/>Because it is
ConstraintLayoutIsn't it because the tag of is closed?
- android studio - androidstudio41 about acquisition of location information
- java - i want to fix an error in android studio
- java - error when building android studio ml kit for firebase [plugin with id'comandroidapplication' not found]
- android - error about gif
- i don't know about intent in android studio (java)
- android studio - [flutter] about flutter doctor
- i get an error when building in android studio
- create an app with android studio "full screen activity" reference location
- i want to make a timetable in android studio
- python - about the error cannot reshape array of size
- ruby - about error of update action when nesting
- java - i want to transition the screen in android studio
- about the barcode reading screen of the android application
- ruby on rails 5 - about lint/syntax error of rubocop
- ruby - about the error content displayed in "rails" rspec
- [unity, android development] about soft keyboard preview
- i can't animate in android studio
- visual studio code - about the current directory of vscode terminal
- about unpickling error in python socket communication
- vba - about index error
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable