错误:无法访问android.app.Activity

时间:2015-05-10 10:07:42

标签: android android-ndk

我正在使用Android应用程序制作头文件我正在使用终端。为此,我在图像中使用以下命令,但会出现以下错误:

Muhammads-MacBook-Pro:MUrgency_with_JNI UsmanKhan$ javah -jni -classpath bin/classes/ -d jni/ com.ziqitza.helper.HelloJni
Error: cannot access android.app.Activity
  class file for android.app.Activity not found
Muhammads-MacBook-Pro:MUrgency_with_JNI UsmanKhan$

enter image description here By accessing to the classes through bin i am getting all of the class names in that particular package

enter image description here

1 个答案:

答案 0 :(得分:3)

看起来您需要指定android.jar的路径,该路径通常位于sdk/platforms/android-version

javah -jni -classpath /path/to/sdk/platforms/android-version/android.jar:bin/classes/ -d jni/ com.ziqitza.helper.HelloJni

javah -jni -bootclasspath /path/to/sdk/platforms/android-version/android.jar  -classpath bin/classes/ -d jni/ com.ziqitza.helper.HelloJni