parseSdkContent失败无法初始化类android.graphics.Typeface [英] parseSdkContent failed Could not initialize class android.graphics.Typeface

查看:233
本文介绍了parseSdkContent失败无法初始化类android.graphics.Typeface的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开布局编辑器,的的是给这个错误:

When I open layout editor, eclipse is giving this error:

parseSdkContent failed
Could not initialize class android.graphics.Typeface

当我尝试运行项目,它给这个错误:

And when I try to run project, it is giving this error :

An internal error occurred during: "Launching myapp".
java.lang.NullPointerException

每当我得​​到这个错误,我要重新启动Eclipse。有没有什么解决办法吗?这个问题开始今天突然。

Every time I'm getting this error and I have to restart eclipse. Is there any solution? This problem started suddenly today.

XML文件:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#66000000"
     >

    <RelativeLayout
        android:id="@+id/refresh_match_layout"
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:layout_centerInParent="true"
        android:layout_margin="15dp"
        android:background="@drawable/app_detay_lay_bg"
        android:orientation="vertical"
        android:padding="10dp"
        android:visibility="visible" >

        <ImageView
            android:id="@+id/app_icon"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:padding="10dp"
            android:textColor="#ffffff"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/app_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:textColor="#000000"
            android:layout_toRightOf="@+id/app_icon"
            android:layout_marginTop="2dp"
            android:textSize="20sp" />

        <ImageButton
            android:id="@+id/app_detail_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="2dp"
            android:background="@null"
            android:src="@drawable/settings_detail"/>

        <ImageButton
            android:id="@+id/app_remove_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/app_icon"
            android:layout_alignTop="@+id/app_detail_button"
            android:background="@null"
            android:src="@drawable/settings_remove" />

    </RelativeLayout>

</RelativeLayout>

错误的图片:

Error picture:

推荐答案

我删除了家用/ .android 文件夹,现在一切正常。

I deleted the home/.android folder and everything is normal now.

的Windows 的,你可以找到这个文件夹中的 C:/用户/用户/

In Windows you can find this folder in C:/Users/User/

来源: http://stackoverflow.com/a/5883841/3681056

请注意:它发生时,你有2个版本的SDK和Eclipse的,无论是在同一台计算机(并使用相同的.android文件),如果打开的其它版本中会出现此错误

Note: it happens when you have 2 versions of SDK and eclipse, both in the same computer (and using the same .android file), if you open on version the other will get this error.

这篇关于parseSdkContent失败无法初始化类android.graphics.Typeface的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆