0

I have created a new GLView component to be aded to different projects. After building the library correctly I am trying to add it to a xml layout in my test app, but it doesn't seem to work as it throws a classnotfound exception.

<?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>

And the class inside the external project is:

public class CustomView extends GLSurfaceView
MLProgrammer-CiM
  • 17,231
  • 5
  • 42
  • 75

1 Answers1

0

How do you attach your library to the project?

As jar lib or as Library project?

I suppose the problem is in wrong configuration. May be jar file placed in "lib" folder instead of "libs".

Dmitriy Lozenko
  • 555
  • 4
  • 5
  • Library project. It can be called from anywhere in the code so it has been correctly imported. The XML files need the lib's namespace definition. – MLProgrammer-CiM Sep 19 '13 at 13:35