Error Cannot Access Android.app.activity
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Javah Error android.app.Activity not found up vote 12 down vote favorite 3 I'm trying to create a .h header file for a simple NDK project. Using cygwin I browse to myprojectDIR\jni directory, then execute this command: javah -o com_myproject_MyActivity.h -classpath myprojectDIR\bin\classes com.myproject.MyActivity then this error message appears: Error: cannot access android.app.Activity class file for android.app.Activity not found I have a native method inside MyActivity class, so I tried to create a new class called NativeAccess (does not extend any class from the android SDK) and it worked fine, the .h file was created, ndk-build and test on device where successful! So my problem is that I need my native methods inside android activities and services that I create, but I cant do that because the Javah command cannot access classes from inside the android-sdk itself. Please notice that I'm using (Windows-7 x64) and I have these environment variables: ANDROID_NDK : C:\Android\android-ndk-r7b ANDROID_SDK : C:\Android\android-sdk ANT_HOME : C:\ANT\apache-ant-1.8.3 JAVA_HOME : C:\Program Files\Java\jdk1.7.0_02 PATH : %JAVA_HOME%\bin;%ANDROID_SDK%\tools;%ANDROID_SDK%\platform-tools;%ANDROID_NDK%;%ANT_HOME%\bin; (other unrelated stuff) Thanks in advance android android-ndk jni javah share|improve this question edited May 7 '12 at 18:25 WhiteKnight 2,34012227 asked May 7 '12 at 14:34 aqm 4671616 You'll need to include the android platform jar(s) in the classpath you use with this tool. If your task is particularly simple you might just create the headers by hand, using the ndk samples as a guide. –Chris Stratton May 7 '12 at 18:38 Thanks Chris, I did thought about adding the classpth of the
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: http://stackoverflow.com/questions/10483959/javah-error-android-app-activity-not-found cannot access android.app.Activity class file for android.app.Activity not found up vote 0 down vote favorite I've looked at the similar questions at: Javah Error android.app.Activity not found and Javah still won't find class files in OSX / Android Studio But my error still isn't resolved. The first link suggests adding Android 8, I don't have Android 8 as I am building for Android 15 http://stackoverflow.com/questions/27847448/error-cannot-access-android-app-activity-class-file-for-android-app-activity-no or higher. So I do have the correct Android15 in my classpath. The other link isn't too specific for a beginner like myself. This is what I have so far as my Javah file, I've included additional classes into my classpath to try to fix the error. This is my one Javah line: javah -classpath
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings http://stackoverflow.com/questions/27201775/javah-android-studio-error-cannot-access-android-support-v7-app-actionbaractivi and policies of this site About Us Learn more about Stack Overflow https://groups.google.com/d/embed/topic/android-ndk/FKrOn_O1e1k the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it error cannot only takes a minute: Sign up javah Android Studio Error: cannot access android.support.v7.app.ActionBarActivity class file for android.support.v7.app.ActionBarActivity not found up vote 3 down vote favorite 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 error cannot access 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 android android-ndk android-studio javah share|improve this question edited Nov 29 '14 at 12:18 Kampai 11.1k125067 asked Nov 29 '14 at 11:37 wald 4328 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote accepted 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. share|improve this answer answered Dec 9 '14 at 19:30 Tony 3,0421121 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 7:02 add a comment| up vote 2 down vote 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\