4

I am following this tutorial on how to use NDK with Android Studio: http://www.ph0b.com/android-studio-gradle-and-ndk-integration/

I have android studio 0.9.3 installled on windows 8, and i follow each step of the tutorial in the video, and at the step to generate jni folder i do this in the android studio's terminal :

D:\ANDROID\workspace\NDKSample\app\src\main>javah -d jni -classpath D:\ANDROID\kits\sdk\platforms\android-19\android.jar;D:\ANDROID\workspace\NDKSample\app\build\intermediates\classes\debug com.jihv.gildas.ndksample.MainActivity

and I have this error :

Error: cannot access android.support.v7.app.ActionBarActivity class file for android.support.v7.app.ActionBarActivity not found

Any help would be greatly appreciated,

Thanks

Kampai
  • 22,848
  • 21
  • 95
  • 95
wald
  • 93
  • 1
  • 2
  • 9

2 Answers2

7

You need to add the support jar files to the classpath too. They'd be in D:\ANDROID\kits\sdk\extras\android\support\v7\appcompat\libs. You need to add both the android-support-v7-appcompat.jar and android-support-v4.jar files.

Tony
  • 3,470
  • 1
  • 18
  • 23
  • i did this. But i have this error what can i do for this. `Error: cannot access android.support.v7.app.ActionBarActivity class file for android.support.v7.app.ActionBarActivity not found` @Tony – Harshana Jan 27 '15 at 07:02
  • Kindly note, current path contains m2repository folder. Moreover, ActionBarActivity is deprecated and AppCompatActivity is used. So, it would be like:-`\AndroidSdkFolder\extras\android\m2repository\com\android\support\appcompat-v7\25.0.1\appcompat-v7-25.0.1-sources.jar` – abhy Feb 10 '17 at 21:15
2

Try add the full path name both with android-support-v7-appcompat.jar and android-support-v4.jar files after android.jar,

For example

D:\ANDROID\workspace\NDKSample\app\src\main>javah -d jni -classpath D:\ANDROID\kits\sdk\platforms\android-19\android.jar;D:\ANDROID\kits\sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat.jar;D:\ANDROID\kits\sdk\extras\android\support\v7\appcompat\libs\android-support-v4.jar;D:\ANDROID\workspace\NDKSample\app\build\intermediates\classes\debug com.jihv.gildas.ndksample.MainActivity

  • relative paths won't work at my visual studio, but your suggestion using full paths worked fine. thanks ! – icaptan Mar 12 '15 at 00:01