2

我想使用 javah 生成标头,但是当我这样做时出现错误:

错误:无法访问 android.support.v4.app.FragmentActivity
  找不到 android.support.v4.app.FragmentActivity 的类文件

我用这个参数创建了新的外部工具:

  • 位置: D:\Android\jdk1.7.0_51\bin\javah.exe

  • 工作目录: D:\Android\workspace\MyApp\bin\

  • 参数: -d D:\Android\workspace\MyApp\jni -classpath D:\Android\workspace\MyApp\bin\classes;D:\Android\workspace\appcompat_v7\libs\android-support-v7-appcompat.jar com .example.myapp.MainActivity

我使用最新版本的 Android SDK 和 NDK 作为最新版本的 Java。有什么建议么?

4

1 回答 1

0

This can be solved by adding android-support-v4.jar to your javah class path arguments.

I am not an Android developer, this was a result of hunting around on Google (for example, information derived indirectly from the answer to IntelliJ 12 + ActionBarSherlock setttings: Could not find class 'android.support.v4.app.FragmentActivity'). I do not know why this is required in addition to standard v7 jars, and I am posting this answer as community wiki in hopes that somebody with more experience can edit it to add some more information in the future.

于 2014-03-17T19:03:24.773 回答