有人能告诉我我在哪里做错了吗?这些是我遵循的步骤:
>从Android开发者网站下载了adt-bundle-windows
>创建了一个新项目和一个libs / armeabi文件夹
>将所有* .so文件从javacv-android-arm.jar,opencv-2.4.3-android-arm.zip和ffmpeg-1.0-android-arm.zip直接提取到新创建的“libs / armeabi”文件夹中,不创建任何新的子目录.
(我不明白的一部分是“从javacv-android-arm.jar中提取所有* .so文件”,我只是在libs / armeabi文件夹中插入了javacv-android-arm.jar文件)
>导航到项目>属性> Java构建路径>库,然后单击“添加JAR …”.
>从新创建的“libs”文件夹中选择javacpp.jar和javacv.jar.
之后我从here下载了OpenCV2.4.3,从here下载了ffmpeg,并在我的C:/ root上提取了文件.
最后在设置我的系统路径后…,
C:\opencv\build\x64\vc10\bin;C:\ffmpeg-64\bin;C:\Program Files\Java\jdk1.7.0_10\bin
…如果我尝试在我的Android应用程序中使用简单的FrameGrabber …
import com.googlecode.javacv.FFmpegFrameGrabber; import com.googlecode.javacpp.Loader; import com.googlecode.javacv.*; import com.googlecode.javacv.cpp.*; import static com.googlecode.javacv.cpp.opencv_core.*; import static com.googlecode.javacv.cpp.opencv_imgproc.*; import static com.googlecode.javacv.cpp.opencv_calib3d.*; import static com.googlecode.javacv.cpp.opencv_objdetect.*; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FFmpegFrameGrabber i = new FFmpegFrameGrabber("/mnt/sdcard/SinglePerson.avi"); }
…我收到以下错误:
01-29 17:59:26.976: E/AndroidRuntime(30656): FATAL EXCEPTION: main 01-29 17:59:26.976: E/AndroidRuntime(30656): java.lang.NoClassDefFoundError: com.googlecode.javacv.FFmpegFrameGrabber 01-29 17:59:26.976: E/AndroidRuntime(30656): at com.example.xxxxxxxxx.MainActivity.onCreate(MainActivity.java:23) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.Activity.performCreate(Activity.java:4465) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.ActivityThread.access$600(ActivityThread.java:123) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.os.Handler.dispatchMessage(Handler.java:99) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.os.Looper.loop(Looper.java:137) 01-29 17:59:26.976: E/AndroidRuntime(30656): at android.app.ActivityThread.main(ActivityThread.java:4424) 01-29 17:59:26.976: E/AndroidRuntime(30656): at java.lang.reflect.Method.invokeNative(Native Method) 01-29 17:59:26.976: E/AndroidRuntime(30656): at java.lang.reflect.Method.invoke(Method.java:511) 01-29 17:59:26.976: E/AndroidRuntime(30656): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 01-29 17:59:26.976: E/AndroidRuntime(30656): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 01-29 17:59:26.976: E/AndroidRuntime(30656): at dalvik.system.NativeStart.main(Native Method)
有人可以帮帮我吗?