Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ndk-build eclipse argument: not find class

We are developing a system for Android devices. For that we are using FC16, Eclipse, SDK, NDK.

In Eclipse: Run > External tool > External Tolls Configurations > we have the tabs:

[Main]
Location:
/usr/java/jdk1.7.0_02/bin/javah
Working Directory:
${workspace_loc:/MyProject/bin}
Arguments:
-d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity

[Refresh]
Specify Resources
MyProject - JNI

Then when clicking on "Apply" and "Run" it comes the error message:

Error: Could not find class file for 'com.myproject.MyActivity'.

But, on the other hand if we go on terminal into the directory /MyProject and run the command:

ndk-build

No error appears, and the program runs as native C++ on Android.

What is missing on Eclipse IDE? Should be something to do with the [Argment] as informed in [External Tolls Configurations], or is it something else we missed?

All comments and suggestions are welcome and highly appreciated.

like image 814
ThreaderSlash Avatar asked Dec 13 '22 05:12

ThreaderSlash


2 Answers

add -classpath it worked for me

-d ${workspace_loc:/MyProject/jni} -classpath ${workspace_loc:/MyProjec/src} com.myproject.MyActivity
like image 155
Ekkarat Prasongsap Avatar answered Dec 16 '22 06:12

Ekkarat Prasongsap


There is one error yet. The correct is:

-d ${workspace_loc:/MyProject/jni} -classpath ${workspace_loc:/MyProject/src} com.myproject.MyActivity

The diference is the t in MyProject/src.

It worked on my project.

like image 31
Lenival Avatar answered Dec 16 '22 08:12

Lenival