Javah:错误:无法访问android.support.v7.app.ActionBarActivity [英] Javah: Error: cannot access android.support.v7.app.ActionBarActivity

查看:148
本文介绍了Javah:错误:无法访问android.support.v7.app.ActionBarActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用javah时遇到问题,我已经阅读了大约4或5个stakcoverflow帖子,错误为已解决",但对我来说一切正常.

I have a problem with javah, I have read about 4 or 5 stakcoverflow posts with the error "solved" but anything works for me.

我的问题:

当我执行javah命令时,出现此错误:

When i execute the javah command i have this error:

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

我尝试过的事情:

这是我测试过的命令:

C:\Users\MyUser\workspace3\PruebaApp\jni\include>javah -classpath ../../bin/classes;C:\Users\MyUser\AppData\Local\Android\sdk\platforms\android-14\android.jar -o ACK.h com.test.prueba.ACK

我也尝试过只用"/"和只用"\"来分隔目录的相同命令.

I have tried too the same command with only "/" and only "\" for separating direcotries.

我已经在android-11,android-14和android-21上进行过尝试.

I have tried it with android-11, android-14, and android-21.

我尝试将以下外部jar添加到我的项目中: "android-support-v4.jar"和"android-support-v7-appcompat.jar"

I have tried to add the following external jars to my project: "android-support-v4.jar" and "android-support-v7-appcompat.jar"

我试图用eclipse创建外部构建配置,例如:

I have tried to do it creating a external build configuration with eclipse, like here: Javah Error android.app.Activity not found

我正在使用的工具

我正在Windows 8.1上使用eclipse juno.

I'm working with eclipse juno, on windows 8.1.

我从中执行命令的文件夹为{project_dir}/jni/include.我从其他文件夹尝试过,正确修改了命令.

The folder from which I executed the command is {project_dir}/jni/include. I have tried it from different folders, modifying the command correctly.

包含本地功能的.java文件在程序包"com.test.prueba"中为"ACK.java"

The .java file that contains the native function is "ACK.java" in the package: "com.test.prueba"

在项目中,我正在使用的android库是android 5.0.1

In the project, the android library that I'm using is android 5.0.1

我该怎么办?预先感谢.

What can I do? Thanks in advance.

推荐答案

在Java类中声明的本机方法足以生成JNI标头.在您的示例中,命令javah的选项-classpath不是很有用.假设com/test/prueba/ACK.java是您处理的用于生成JNI标头的类.您可以将工作目录更改为{project_dir}\src,执行命令

The native methods declared in your java class is enough for generating JNI header. In your example, the command javah's option -classpath is not very useful. Suppose com/test/prueba/ACK.java is the class you process to generate JNI header. You can change the working directory to {project_dir}\src, execute the command

javah com.test.prueba.ACK

相应的JNI头文件com_test_prueba_ACK.h将在当前目录中创建.

the corresponding JNI header file com_test_prueba_ACK.h will be created in the current directory.

这篇关于Javah:错误:无法访问android.support.v7.app.ActionBarActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆