The Javah command is used to generate the. h file under the command line, and the workaround for "error: Unable to access android.app.Activity found Android.app.Activity class file" appears

Source: Internet
Author: User

In learning the NDK, when I used the Javah command to generate a header file in the project's bin/classes directory, there was an "error: unable to access the android.app.Activity found Android.app.Activity class file" issue, as follows

Jump to the project's SRC directory using the Javah command, instead of using the Javah command under the project's Bin/classes directory!

Unable to access android.app.Activity is a description without introducing Android.jar package
You can look at the specific instructions inside the java-h.
There is a-bootclasspath parameter that allows him to point to the Android.jar package
Here's an example: Javah-classpath bin/classes-bootclasspath D:\Environment\android-sdk-windows\android-sdk-windows\ platforms\android-16\android.jar-d JNI com.jm.promedia.SecondActivity

Alternatively, you can also go to the SRC directory under javah-d. /jni com.jm.promedia.SecondActivity

Where-D is to create a directory to put the generated files in

The Javah command is used to generate the. h file under the command line, and the workaround for "error: Unable to access android.app.Activity found Android.app.Activity class file" appears

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.