android eclipse错误集合

   1.  devices.xml 错误

 

   [2016-09-14 15:20:11 - Android SDK] Error when loading the SDK:

 

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-22\android-wear\x86\devices.xml

cvc-complex-type.2.4.d: 发现了以元素 'd:skin' 开头的无效内容。此处不应含有子元素。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-23\android-wear\armeabi-v7a\devices.xml

cvc-complex-type.2.4.d: 发现了以元素 'd:skin' 开头的无效内容。此处不应含有子元素。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-24\android-wear\armeabi-v7a\devices.xml

cvc-enumeration-valid: 对于枚举 '[ldpi, mdpi, tvdpi, hdpi, xhdpi, xxhdpi, xxxhdpi]', 值 '280dpi' 不具有面有效性。它必须是来自枚举的值。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-24\android-wear\x86\devices.xml

扫描二维码关注公众号,回复: 580157 查看本文章

cvc-enumeration-valid: 对于枚举 '[ldpi, mdpi, tvdpi, hdpi, xhdpi, xxhdpi, xxxhdpi]', 值 '280dpi' 不具有面有效性。它必须是来自枚举的值。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-22\android-wear\x86\devices.xml

cvc-complex-type.2.4.d: 发现了以元素 'd:skin' 开头的无效内容。此处不应含有子元素。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-23\android-wear\armeabi-v7a\devices.xml

cvc-complex-type.2.4.d: 发现了以元素 'd:skin' 开头的无效内容。此处不应含有子元素。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-24\android-wear\armeabi-v7a\devices.xml

cvc-enumeration-valid: 对于枚举 '[ldpi, mdpi, tvdpi, hdpi, xhdpi, xxhdpi, xxxhdpi]', 值 '280dpi' 不具有面有效性。它必须是来自枚举的值。

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-24\android-wear\x86\devices.xml

cvc-enumeration-valid: 对于枚举 '[ldpi, mdpi, tvdpi, hdpi, xhdpi, xxhdpi, xxxhdpi]', 值 '280dpi' 不具有面有效性。它必须是来自枚举的值。

 

解决:

复制 D:\Users\shouzhuo3\AppData\Local\Android\sdk\tools\lib\devices.xml

替换

Error: Error parsing D:\Users\shouzhuo3\AppData\Local\Android\sdk\system-images\android-24\android-wear\x86\devices.xml

 

  2.  styles.xml 错误

 

[2016-09-14 16:00:56 -] F:\workspace_new\androidShow\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

[2016-09-14 16:00:56 -] 

[2016-09-14 16:00:56 -] F:\workspace_new\androidShow\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

[2016-09-14 16:00:56 -] 

[2016-09-14 16:00:56 -] F:\workspace_new\androidShow\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.

[2016-09-14 16:00:56 -] 

 解决:

查看 res/values/styles.xml 下的报错点。

 <style name="AppBaseTheme" parent="Theme.AppCompat.Light">

把这个改成

<style name="AppBaseTheme" parent="android:Theme.Light">

路径: res/values-11/styles.xml 

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">

把这个改成

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">

路径: res/values-14/styles.xml 

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">

把这个换成 

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">

  3.  main.xml 错误

  <item

        android:id="@+id/action_settings"

        android:orderInCategory="100"

        android:title="@string/action_settings"

        app:showAsAction="never"/>

解决:app 换成  android:showAsAction="never"

   4. eclipse创建Android项目,就会报错android.support.v7.app.ActionBarActivity

   解决:

     找到android SDK 目录: Android\sdk\extras\android\support\v7\appcompat 这个项目

     导入到eclipse中   导入过程中 "Copy projects into workspace" 

     把导入的项目添加到报错的工程中

 

5.更新sdk 后 打包错误

  1 . This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView)

      解决方案:菜单栏window ——>Preferences——>Android——>Lint error Checking——>在issues搜           索:    Instantiatable

      然后把对应的severity改为warning即可。

  2 . Duplicate id @+id/image, already defined earlier in this layout Issue

          Duplicate id @+id/image, already defined earlier in this layout Issue: Checks for duplicate ids               within         a single layout Id: DuplicateIds Within a layout, id's should be unique since otherwise              findViewById()         can return an unexpected view.

       This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView) Issue:            Ensures that classes registered in the manifest file are instantiatable Id: Instantiatable Activities,                services, broadcast receivers etc. registered in the manifest file must be "instantiatable" by the          system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class

    这个问题的类型应该为support v7 出现问题,一个id名称重复了,估计是官方的问题。。上回那个android SDK 新建工程要重复build,现在又tools export出问题,更新都要考虑风险了

3 . XXX" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic).....

app_name" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan),  

"cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "en-rGB" (English: United Kingdom), "en-rIN" (English:  

India), "es" (Spanish), "es-rUS" (Spanish: United States), "et-rEE" (Estonian: Estonia), "fa" (Persian),  

"fi" (Finnish), "fr" (French), "fr-rCA" (French: Canada), "hi" (Hindi), "hr" (Croatian), "hu" (Hungarian), "hy- 

rAM" (Armenian: Armenia), "in" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ka-rGE" (Georgian:  

Georgia), "km-rKH" (Khmer: Cambodia), "ko" (Korean), "lo-rLA" (Lao: Lao People's Democratic Republic),  

"lt" (Lithuanian), "lv" (Latvian), "mn-rMN" (Mongolian: Mongolia), "ms-rMY" (Malay: Malaysia), "nb" (Norwegian  

Bokmål), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "pt-rPT" (Portuguese: Portugal), "ro" (Romanian),  

"ru" (Russian), "sk" (Slovak), "sl" (Slovene), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "th" (Thai),  

"tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "vi" (Vietnamese), "zh-rCN" (Chinese: China), "zh-rHK" (Chinese:

Hong Kong), "zh-rTW" (Chinese: Taiwan, Province of China), "zu" (Zulu) 

解决 :

一种是“fix these before running Export ”

另一种是“turn off 'Run full error check when exporting app'”

方法如下:Preference -> Android -> Lint Error Checking 

(1“turn off 'Run full error check when exporting app'“

   在Eclipse中打开Preference,去掉勾选

(2)“fix these before running Export ”

   Issues -> 搜索 MissingTranslation  -> Severity ->Error

   1》If the string should not be translated, you can add the attribute translatable="false" on the <string> element,

      添加属性 translatable="false"

   2》or you can define all your non-translatable strings in a resource file called donottranslate.xml.

     我们可以将所有不需要non-translatable 的字符串统一放入一个名叫donottranslate.xml的文件中。

    在values新建donottranslate.xml文件,并把不需要non-translatable 的字符串放入其中.

   3》Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.

     用tools:ignore="MissingTranslation“ 属性直接忽略这个问题

猜你喜欢

转载自ogc.iteye.com/blog/2324398