Link to Android user library causes runtime class to not detect application error

I am working on an Android custom library. I start with a java project (in Eclipse) with another Android project for Android.

In my user interface testing project, I refer to the library project in the build path, and everything is fine, and I can check the library codes in the user interface.

Later, I decided that I needed the “Gen” code (for custom style attributes), so I try to change my library to an Android project (via Android-tools → convert ..), and disasters happen! After fixing all the compile-time issues, finally “let me” run the application to test the user interface and beats! When I try to create any objects from the library class, he said (in the log) that the Class was not found .

Two questions:

  • Any idea how to fix this? I tried, but it seems to refer to a link to another .apk that needs to be installed separately.

  • If I just want it to be a java project (not android) for my library, can I use a resource generator? And How?

PS: the dependency (my library) is installed before the test user interface application, according to the Eclipse console.

Update: I tried to compile the library project with jar and reference it from user interface testing, and this way it works. But I do not want to use this approach, since it is very slow in terms of testing.

+3
source share
2 answers
Finally, I found the answer to my question. This is actually mentioned in the official documentation.
-8
source

for those who make the same mistake as me

when the library project - the android project got to

properties> android> click the add button at the bottom of the popup window inside the library section

and add a project instead

a > Java > >

java-.

+1

Source: https://habr.com/ru/post/1783585/


All Articles