R文件,styles.xml和android.graphics.Typeface

时间:2014-08-04 15:14:06

标签: android xml eclipse

我在Linux中安装了Luna并从juno / kepler导入了我的项目(现在不确定),我收到以下错误

我的 R 文件消失了,我认为这是由于xml解析错误造成的。

每当打开与布局相关的任何* .xml时,我都会收到此消息:

parseSdkContent failed Could not initialize class android.graphics.Typeface x 2(发生多个错误)

我在/ home中删除了 .android 作为建议的答案,但错误仍然存​​在。

我在我的项目中运行 Android 2.2 (我可以看到该库已包含在内)虽然Right Click -> Project Properties -> Android -> Has Android 2.2, Android 4.4W and Android L (Preview) 所有未选中,但“应用”按钮不存在我关闭窗口时工作(选择android 2.2)。

每当我打开 Android SDK Manager 时,我都会收到此消息

parseSdkContent failed Could not initialize class android.graphics.Typeface

在我的styles.xml文件中,我有以下错误:

error => <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> <!-- API 11 theme customizations can go here. --> </style>

error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.

error => <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> <!-- API 14 theme customizations can go here. --> </style>

error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.

我检查了 android sdk manager 中的更新,发现没有,已安装:

  • 工具
  • Android SDK工具
  • Android SDK平台工具
  • Android SDK Build-tools
  • ANDROID L API 20,L预览
  • SDK平台Android L预览
  • Android TV ARM EABI v7a系统映像
  • Android TV Intel x86 Atom System Image
  • ANDROID 4.4W API 20
  • SDK平台
  • Android Wear ARM EABI v7a系统映像
  • Android Wear Intel x86 Atom System Image
  • ANDROID 2.2 API 8
  • SDK平台
  • Android支持库

这是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.diverse.just"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="20" />

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.diverse.just.MainActivity"
            android:label="@string/app_name" >
              <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.diverse.just.LoginActivity"
            android:label="@string/title_activity_login"
            android:windowSoftInputMode="adjustResize|stateVisible" >
        </activity>
    </application>

1 个答案:

答案 0 :(得分:0)

如果res文件夹中没有任何错误R文件未生成。您在styles个文件夹中有错误,因为android:Theme.Holo.Light无法使用android:Theme.Holo.Light.DarkActionBarapi-8(android 2.2)

  1. 右键点击您的项目。
  2. 转到属性。
  3. 从左侧面板中选择Android选项。
  4. 检查任何Android platform 3.0 or above
  5. 清理您的项目。
  6. 编辑: