Error reporting: no content is allowed in the preface

Time:2021-9-19

Error code:

Execution failed for task ‘:app:mergeDebugResources’.

> Could not resolve all files for configuration ‘:app:_internal_aapt2_binary’.
> Could not resolve com.android.tools.build:aapt2:4.1.0-6503028.
Required by:
project :app
> Could not resolve com.android.tools.build:aapt2:4.1.0-6503028.
> Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.1.0-6503028/aapt2-4.1.0-6503028.pom
> ǰ���в����������ݡ�

 

Try one

Answer website: https://blog.csdn.net/qq_ 35928566/article/details/103474974

Possible: unable to merge resources. It is the reference error of the original components referenced by XML, such as LinearLayout. This situation is generally caused by the confusion of Android studio cache, that is, the confusion of project cache when you open multiple different gradles.

Solution: Android studio click file → invalidate cache / restart → invalidate and restart

Wait for the reboot to resolve

Note: only one item can be opened before clicking invalidate and restart. Otherwise, gradle will start together and conflict after restarting

The problem is not solved, and an error is still reported during real machine simulation

 

Try two:

Most online methods are:
Move the assets file to the Src / main / directory,
Because the assets directory and res directory should be placed under the same level directory. But no assets were created

//To be solved