Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build on Windows fails #13

Open
RedstoneMedia opened this issue Feb 21, 2022 · 2 comments
Open

Android build on Windows fails #13

RedstoneMedia opened this issue Feb 21, 2022 · 2 comments

Comments

@RedstoneMedia
Copy link

Running flutter build apk --debug on my Windows 10 system fails with this error :

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':native_opencv:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process D:\Programms\Android\sdk\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C <project-path>\flutter_native_opencv\native_opencv\android\.cxx\cmake\debug\arme
abi-v7a native_opencv}
  ninja: Entering directory `<project-path>\flutter_native_opencv\native_opencv\android\.cxx\cmake\debug\armeabi-v7a'

  ninja: error: '../../../../src/main/jniLibs/armeabi-v7a/libopencv_java4.so', needed by '<project-path>/build/native_opencv/intermediates/cmake/debug/obj/armeabi-v7a/libnative_opencv.so', mi
ssing and no known rule to make it

Is this a known issue or am I doing something wrong ?

@srodrigo
Copy link

srodrigo commented May 2, 2022

Hi @RedstoneMedia - I ran into the same issue. You probably need to follow these steps on the README, to add the sdk https://github.com/westracer/flutter_native_opencv/blob/master/README.md?plain=1#L13-L19

@andy6804tw
Copy link

To fix this you have to write this code in native_opencv/android/app/build.gradle file

android {
    packagingOptions {
        pickFirst 'lib/armeabi-v7a/libopencv_java4.so'
        pickFirst 'lib/arm64-v8a/libopencv_java4.so'
        pickFirst 'lib/x86/libopencv_java4.so'
        pickFirst 'lib/x86_64/libopencv_java4.so'
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants