Eclipse: Error in xml Graphical Layout after the new update

不羁的心 提交于 2019-11-28 10:36:32

问题


I updated the Android tools, etc from :

  • SDK Manager
  • help->check for updates
  • help-> Install new Software...

It is actually an improvement with fragment now included when creating an activity.

I get this error in each and every Graphical layout of every xml

Error Log:

I added layoutlib-api-22.4.2.jar Add to build path in the project but didn't worked !

How to solve this issue ?

Thanks in advance


回答1:


The new update has a lot of problems the easy way is create your project from command line then import it to eclipse to do that:

  1. Go to sdk folder for example mine is (The folder included android execute):

    $ cd Program/android/adt/sdk/tools/

  2. Get list of target:

    $ ./android list

    Available Android targets:

    id: 1 or "android-7" Name: Android 2.1 ...

  3. Choose one of the target in that list and put the id in this command to create android project:

    $ ./android create project --target 24 --name MyFirstApp --path MyFirstApp --activity Main --package com.mrg.myfirstapp

  4. Then it made for you. now in eclipse right click on project explorer:

5.Select this:

6.Rename project name if you want and press Finish

then it may works




回答2:


Oh, just changing the Android version to use when rendering layouts situated at top right corner avoid the problem :)

Now I didn't get any error! :)


回答3:


Try to install ADT plugins

  1. Start Eclipse, then select Help > Install New Software.
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/
  4. Click OK and go on :) All the instruction can be found in the guide Install plugin


来源:https://stackoverflow.com/questions/22344320/eclipse-error-in-xml-graphical-layout-after-the-new-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!