android mingw32 build error: -dex failed or was not executed

asked 2018-02-04 20:44:33 -0500

9261 gravatar image

updated 2018-02-05 17:06:16 -0500

I am attempting to build opencv4android with mingw32-make. My build failed while generating android_test\bin\OpenCVTest-debug.apk, giving the error:

Target '-dex' failed with message 'The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:890: The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:902: The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:283: null returned: 1'.

Cannot execute '-package' - '-dex' failed or was not executed.

Cannot execute '-do-debug' - '-package' failed or was not executed.

Cannot execute 'debug' - '-do-debug' failed or was not executed.

BUILD FAILED C:\Android\sdk\tools\ant\build.xml:888: The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:890: The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:902: The following error occurred while executing this line:

C:\Android\sdk\tools\ant\build.xml:283: null returned: 1

The command line output claimed the error came from the sdk/tools/ant/build.xml file. I checked the file, the lines that were giving it problems were:

<do-only-if-manifest-hasCode elseText="hasCode = false. Skipping..."> (Line 888)

<do-only-if-not-library elseText="Library project: do not convert bytecode..." > (line 890)

<dex-helper /> (line 902)

verbose="${verbose}"> which was part of <dex executable="${dx}" output="${intermediate.dex.file}"dexedlibs="${out.dexed.absolute.dir}" nolocals="@{nolocals}" forceJumbo="${dex.force.jumbo}" disableDexMerger="${dex.disable.merger}" verbose="${verbose}"> (line 283)

Here is my CMake configuration output also:

Looking for ccache - not found

OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target

SYSROOT

Found apache ant: C:/ant/ant-1.10.1/bin/ant.bat (1.10.1)

Caffe: NO

Protobuf: NO

Glog: NO

Looking for tiny_dnn.h

Looking for tiny_dnn.h - not found

Module opencv_dnn_modern disabled because tiny-dnn was not found

freetype2: NO

harfbuzz: NO

Module opencv_ovis disabled because OGRE3D was not found

No preference for use of exported gflags CMake configuration set, and no hints for include/library directories

provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.

Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.

Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for

installed gflags components.

Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h

Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing

glog/logging.h

Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags

Excluding from source files list: C:/opencv-master/modules/core/src/convert.avx2.cpp

Excluding from source files list: C:/opencv-master/modules/core/src/convert.fp16.cpp

Excluding from source files list: C:/opencv-master/modules/core/src/convert.sse4_1.cpp

Excluding from source files list: C:/opencv-master/platforms/android_arm/modules/core/mathfuncs_core.sse2.cpp

Excluding from source files list: C ... (more)

edit retag flag offensive close merge delete

Comments

Please add information about commands you run and configuration output from cmake.

mshabunin gravatar imagemshabunin ( 2018-02-05 03:21:23 -0500 )edit

I added the CMake configuration output. I use the command mingw32-make to build the project

9261 gravatar image9261 ( 2018-02-05 17:07:04 -0500 )edit