Android XML error message

2020-07-06 02:58发布

Everytime I open an XML layout file, the following error message displays:

An internal error occurred during: "Check Android SDK". java.util.ConcurrentModificationException

The error message is easily dismiss-able, and my program still runs fine. I have tried restarting Eclipse and my computer with no success. The problem has not always been there, but I am not entirely sure when it started happening. Any ideas or links are appreciated!

Example XML file

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    tools:context="${packageName}.${activityClass}" >

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="@dimen/text_title_main"
    android:text="@string/app_name" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="@dimen/text_subtitle_main"
    android:text="@string/app_desc" />

</LinearLayout>

Exact error message

Example of popup

4条回答
Luminary・发光体
2楼-- · 2020-07-06 03:33

Check your AndroidManifest.xml and see if the targeted SDK version matches the latest Android SDK Build tool you have downloaded.

Also check Eclipse under Window -> Preferences -> Android if the Platform is available and if the max API level matches.

查看更多
乱世女痞
3楼-- · 2020-07-06 03:35

Well your code is fine and I'm not sure why there is an error. There is some thing you can try as the error asks you to check "android SDK"

In the menu bar

Select tools>-android>-SDK manager

and download the SDK build tools, SDK platform and Google API's for the target SDK version of your project.Make sure you have downloaded all the new updates, if any

if you are not sure which items you have to download , you can select all of them.(will take more time to download of course).no harm in trying

Restart the IDE

You can find more info here: https://developer.android.com/sdk/installing/adding-packages.html

查看更多
ら.Afraid
4楼-- · 2020-07-06 03:35

I had the same problem and i resolve it by changing the target in the ADT plug-in

enter image description here

then chose the API that you are using in your application .

查看更多
smile是对你的礼貌
5楼-- · 2020-07-06 03:37

Delete

.metadata

folder that is in your workplace. Then import your project back. You will be good to go.

Warning you will lose your workspace settings.

查看更多
登录 后发表回答