由ClassNotFoundException引起的类错误

时间:2013-03-13 00:45:31

标签: android adt gradle android-library dex

提前感谢您的帮助。

我正在使用新的构建系统(gradle)来安装android。 从eclipse构建时,应用程序正常运行。 但是,从gradle使用构建时,我遇到了引用库的问题。

启动库的第一个活动时,它可以正常工作。但是,一旦“加载”活动完成,我的应用程序在尝试启动下一个活动时崩溃。

在logcat中我看到:

RuntimeException: Unable to start activity ComponentInfo____________ android.view.InflateException: Binary XML file line #14: Error inflating class__________

...

引起:java.lang.ClassNotFoundException

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context=".Player" >

    <FrameLayout
        android:id="@+id/id"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone" >

        <com.my.class.name
            android:id="@+id/id2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </FrameLayout>

0 个答案:

没有答案