我在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 中的更新,发现没有,已安装:
这是我的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>
答案 0 :(得分:0)
如果res
文件夹中没有任何错误R
文件未生成。您在styles
个文件夹中有错误,因为android:Theme.Holo.Light
无法使用android:Theme.Holo.Light.DarkActionBar
和api-8(android 2.2)
Android
选项。platform 3.0 or above
。编辑:
您可以使用@android:style/Theme.Black.NoTitleBar
此主题。
Or
导入Appcompat from sdk并使用appcompat's
主题。
Or
使用Holo Everywhere