R file, styles.xml and android.graphics.Typeface



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

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

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

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

我删除了。android inside/home如答案所示,但错误仍然存在。

我在我的项目中运行Android 2.2(我可以看到包含库),尽管Right Click -> Project Properties -> Android -> Has Android 2.2, Android 4.4W and Android L (Preview) ALL未选中,当我关闭窗口(选择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管理器中的更新,发现没有,已经安装:

    工具>:Android SDK工具Android SDK平台工具Android SDK Build-tools
  • android l API 20,1预览:
  • SDK平台Android L预览
  • Android TV ARM EABI v7a系统映像
  • Android TV Intel x86 Atom System Image
  • android 4.4w API 20<
  • SDK平台/gh>
  • Android Wear ARM EABI v7a系统映像
  • Android Wear Intel x86 Atom System Image
  • android 2.2 API 8
    :<
  • SDK平台/gh>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>

如果res文件夹有任何错误,则R文件不生成。styles文件夹出现错误,因为android:Theme.Holo.Lightandroid:Theme.Holo.Light.DarkActionBarapi-8(android 2.2)不可用

  1. 右键单击你的项目。
  2. 从左面板选择Android选项
  3. 检查所有android platform 3.0 or above
  4. 清理项目。
编辑:

  • 您可以使用@android:style/Theme.Black.NoTitleBar这个主题

  • Or从sdk中导入Appcompat并使用appcompat's主题

  • Or Use Holo Everywhere

相关内容

最新更新