Errors running builder 'CDT Builder' when trying to build OpenCV for android samples

23,446

Solution 1

try

Project Properties>C/C++ Build>Tool Chain Editor

Current toolchain: Android GCC
Current builder: Android Builder

Project Properties>C/C++ Build

(uncheck) use default build command
Build command: ndk-build
(uncheck) generate Makefiles automatically

Solution 2

You may have renamed the project, and the eclipse forgot to rename the "Refresh Policy".

Just update "Project properties -> C/C++ Build -> Refresh Policy" manually solved my problem.

BTW, ADT has some very bad error descriptions as of in this case.

Solution 3

These works for me:

Build command: ndk-build
(uncheck) generate Makefiles automatically 

Solution 4

I might have the same problem, try ndk-build -B which rebuild all the things, see whether you still got error, if no error remain, there is no problem with your ndk-build. try to run your android apps without CDT installed, if this works, at least we could use comand line to build the c++ part of code.

but CDT is still not working well, after I install the CDT according to the opencv doc, I got lots of errors, add the cygwin and gcc things to the path would solved most of it. But the last things every strange is, I got an error here.

in the face detection sample, .cpp part

catch(cv::Exception e)
{
    LOGD("nativeCreateObject catched cv::Exception: %s", e.what());

it always says symbol "e" can not be resolved.

but no error when I include the opencv things. even when I try to put cv::Exception e outside of the catch()

Share:
23,446
Niko Adrianus Yuwono
Author by

Niko Adrianus Yuwono

Mobile Developer based in Singapore. You can find me on : Github Twitter

Updated on July 09, 2020

Comments

  • Niko Adrianus Yuwono
    Niko Adrianus Yuwono almost 4 years

    Hello guys I'm trying to learn about openCV in android I've already following the instruction given here

    but when I'm trying to compile I'm only getting

    01:50:14 ** Auto Build of configuration Default for project org.opencv.samples.fd.FdActivity ** "C:\Android\android-ndk-r8\ndk-build.cmd" Install: libdetection_based_tracker.so => libs/armeabi-v7a/libdetection_based_tracker.so

    01:50:14 Build Finished (took 184ms)

    in the console and I'm also get an error

    Errors occurred during the build. Errors running builder 'CDT Builder' on project 'org.opencv.samples.fd.FdActivity'. Internal error building project org.opencv.samples.fd.FdActivity configuration Default java.lang.NullPointerException Internal error building project org.opencv.samples.fd.FdActivity configuration Default java.lang.NullPointerException

    anyone ever encountered this problem before? please help me to solve this problem

    thank you

  • Francis Pierot
    Francis Pierot almost 9 years
    Thanks. This one just fixed my project build.