steveliles/opencv-android

How to build OpenCV3.2.0 aar file ?

Closed this issue · 1 comments

Hi, steveliles.

I followed your steps for building an OpenCV4Android aar file!

  1. Fire up Android Studio and create a Library Project
  2. Copy the java sources from the OpenCV4Android bundle into src/main/java in your library project
  3. Copy the native library directories from the OpenCV4Android bundle into src/main/jniLibs
  4. Build the .aar

Could you help me out ?

@steveliles I solved the issue.

  1. java sources files not conclude the android/AsyncServiceHelper.java file!
  2. Comment the following code in android/OpenCVLoader.java file.
    /**
     * Loads and initializes OpenCV library using OpenCV Engine service.
     * @param Version OpenCV library version.
     * @param AppContext application context for connecting to the service.
     * @param Callback object, that implements LoaderCallbackInterface for handling the connection status.
     * @return Returns true if initialization of OpenCV is successful.
     */
//    public static boolean initAsync(String Version, Context AppContext,
//            LoaderCallbackInterface Callback)
//    {
//        return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
//    }
  1. Copy values/attrs.xml to my own android library's values/attrs.xml;
  2. Change my own library's values/string.xml like this:
<resources>
    <string name="app_name">OpenCV-3.2.0</string>
</resources>