0

我创建了一个新的 GLView 组件以添加到不同的项目中。正确构建库后,我尝试将其添加到我的测试应用程序中的 xml 布局中,但它似乎不起作用,因为它引发了 classnotfound 异常。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:lib="http://schemas.android.com/apk/res-auto"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" 
android:background="@android:color/darker_gray">

<com.exapmple.library.CustomView
android:id="@+id/glsurfaceview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>

外部项目中的类是:

public class CustomView extends GLSurfaceView
4

1 回答 1

0

你如何将你的库附加到项目中?

作为 jar lib 还是作为库项目?

我想问题出在错误的配置中。可能是 jar 文件放在“lib”文件夹而不是“libs”中。

于 2013-09-19T13:15:49.530 回答