ndk-build eclipse argument: not find class

2020-06-23 09:21发布

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.

2条回答
We Are One
2楼-- · 2020-06-23 09:39

add -classpath it worked for me

-d ${workspace_loc:/MyProject/jni} -classpath ${workspace_loc:/MyProjec/src} com.myproject.MyActivity
查看更多
聊天终结者
3楼-- · 2020-06-23 09:50

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.

查看更多
登录 后发表回答