After the import step on this page: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html#import-opencv-library-and-samples-to-the-eclipse
I keep getting the following errors like in a popup in Eclipse:
Building workspace: Errors occurred during the build. Errors running
builder 'Android Resource Manager' on project 'OpenCV Library -
#OPENCV_VERSION#'. java.lang.NullPointerException Errors running
builder 'Android Resource Manager' on project 'OpenCV Sample - 15
puzzle'. java.lang.NullPointerException Errors running builder
'Android Resource Manager' on project 'OpenCV Sample -
camera-calibration'. java.lang.NullPointerException
Cleaning all projects: Errors occurred during the build. Errors
running builder 'Android Package Builder' on project 'OpenCV Library -
#OPENCV_VERSION#'. Resource '/OpenCV Library - #OPENCV_VERSION#/bin'
does not exist. Resource '/OpenCV Library - #OPENCV_VERSION#/bin' does
not exist. I followed the warning and note given at the bottom as
well, but that did help.
My OpenCV4Android SDK version is 2.4.9.
I ran into the same problem -- I didn't wind up needing to switch to OpenCV4Android 2.4.8, but deleting my 2.4.9 directory and re-unzipping it and going through the steps from scratch seemed to fix everything. I'm sure I just corrupted some files, and re-extracting my SDK fixed it.
So long story short:
Make sure you follow EVERY step in the tutorial:
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html
Make SURE that when you import the sample projects that you do it from the ROOT of the SDK directory -- not from the sample directory -- otherwise you miss the library.
Make SURE that you don't extract your OpenCV directory into a directory with spaces in the path (such as "My Documents").
And if you're wrestling it with a while and you can't seem to get it working, then don't hesitate to quit eclipse, delete your workspace, delete your OpenCV directory, and re-extract from the downloaded zip file and try again.
I had the same frustrating problem, I had to do two steps (different again!):
Open Properties for the Open CV library project (mine was OpenCV Library - 2.4.10), go to Android -> Project Build Target, and select a target name. (This is mentioned in the tutorial.)
Still in the Properties dialog, go to Java Build Path -> Source, at the bottom where it says Default output folder: mine said "OpenCV Library - 2.4.10/cls" - I changed this to "OpenCV Library - 2.4.10/bin"
And now it's building without errors.
I did both of the following together:
Set NDKROOT for all projects individually even though the environment variable existed in my bashrc.
Switched to OpenCV4Android SDK version 2.4.8
Related
I have been trying endlessly to build the sample HelloJni sample project for the Android NDK.
How I set up the environment:
I followed the instructions of the getting started in the docs: android-ndk-r10d\docs\Getting_Started/html/index.html:
Downloaded Eclipse Luna
Downloaded the Android SDK
Downloaded the Android NDK: android-ndk-r10d
Set the NDK installation folder in eclipse in preferences window -> android -> NDK.
Imported the hellp-jni sample.
Right click on the HelloJni Project -> Android tools -> Add native support.
Cleaned and Built the project.
Ran on my device the HelloJni library (not the tests)
And the app is running and everything is WORKING and I can see the generated .so file per architecture in the libs folder of the project (for every architecture, for example armebi, mips, etc...)
Here is a Print Screen showing everything is working:
Now here comes the strange part...
The Problem:
If I open the hello-jni.c file for editing or viewing in eclipse, I suddenly see compilation errors and I can't build and can't run the project anymore...
Here is a Print Screen showing that after i open the file, I suddenly get compilation errors:
What I have already tried but failed:
Adding the Android Native Nature, then removing it by:
Deleting the .project file,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.genmakebuilde,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
and removing the lines:
[nature]org.eclipse.cdt.core.cnature[/nature]
[nature]org.eclipse.cdt.core.ccnature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.managedBuildNature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.ScannerConfigNature[/nature]
removing the .cproject and all compiled files.
Then adding back the Android Native Nature.
According to this stackoverflow link:
Eclipse ADT - Unresolved inclusion jni.h
Failed
Once I got the error of (I am not getting it anymore): Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath". So I Googled and I changed the build settings to give the absolute path of my NDK installation folder:
According to this stackoverflow link:
Unable to launch cygpath in android
Here is a Print Screen:
Failed
Changing the Used tools from Android GCC Compiler to GCC C Compiler
according to this stackoverflow link:
Android NDK build, Method could not be resolved
Here is a Print Screen:
Failed
Copying an eclipse Luna installation from a friend that has the project working for him.
Failed
I have been spending hours on this and I couldn't find any solution to why this is happening.
PLEASE HELP
This is a common problem when you try to edit a C/C++ file inside a JAVA workspace/perspective without the proper configuration. You can simply select all the entries in the Error Log and delete them.
FWIW, Eclipse seems to have issues with the r10d version of Android NDK. See https://code.google.com/p/android/issues/detail?id=97023. I suggest you try r10c instead #worksforme :)
I'm trying to compile the Android project SGTPuzzles, and am running into problems that I need help understanding. The error is:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'SGTPuzzles'.
Path must include project and resource name: /SGTPuzzles
I'm new to Android development (and Eclipse and Java), and so I'm not really sure how to figure out the source of the error. I'm running Ubuntu 12.04, ADT v22.3, and have imported the SGTPuzzles project into my Eclipse workspace with the included Git tools.
I searched the web and found similar problems here and here (among some less useful non-stackoverflow results), but no solutions. I've tried clearing my workspace, re-cloning the repository, and restarting Eclipse. I've tried the 'Android Tools'->'Fix Project Properties'. Nothing has helped. I don't know where to look to learn more about what file or resource is causing this problem, so it's tricky for me to debug. Any suggestions would be really appreciated. Thanks!
This helped me:
Right click on the project and go to "Properties"
Select "Java Build Path" on the left
Open "Source" tab
Remove "YourProject" from source files (make sure "gen" folder and "src" are in the source files)
Again right click on the project and in the "Andriod Tools" click on "Fix Project Properties"
This one's my fault: I had the *.c files at the root of the project (hoping to keep the same paths as upstream svn), and thus the root as a source folder, and ADT started objecting to that, by crashing in com.android.ide.eclipse.adt.internal.build.SourceProcessor.buildSourceFileList() trying to resolve /SGTPuzzles to a project and resource (i.e. subfolder), which fails. Fixed in current git by mv *.c jni/.
As soon as I finish importing the android support library project into my workspace (I am using eclipse ide), I receive this error message:
Could not not write to file: C:\Program Files\extras\android\support\v7\appcompat\bin
The library project appears in my workspace, however if i try a clean build:
Errors occurred during the build. Errors running builder 'Android
Package Builder' on project 'android-support-v7-appcompat'. Resource
'/android-support-v7-appcompat/bin' does not exist.
Here is the stack trace:
[2013-12-17 18:11:20 - android-support-v7-appcompat] Android requires
compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use
Android Tools > Fix Project Properties.
The error log also states that bin folder does not exist/cannot be written to.
Here are things I have tried so far and failed:
1. Clean build
2. Install then re install
3. Fix android properties.
I have not used any of the API from the support library.
Open the project properties in Eclipse. Choose Java Compiler and make sure the Compiler Compliance level is set to 1.5 or 1.6.
I keep getting a generic error when I try to create an Android project using the m2e-android plugins. I follow the basic steps here:
http://rgladwell.github.io/m2e-android/
using version Archetype version 1.0.11, but each time I find that my project has an error of some sort. The project folder in Eclipse has an exclamation point on it, which I think indicates a build path error, but I have no idea where the problem lies. When I try to clean the project I get the error:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'LookAroundYou'.
java.lang.NullPointerException
Errors running builder 'Android Pre Compiler' on project 'MainActivity'.
java.lang.NullPointerException
I have read about this error but almost every solution I have found indicates it is a problem with SVN, but I am not using SVN.
I'm pretty new to Eclipse and Android dev and only recently installed NDK and OpenCV and ever since I've been battling. Win8/Eclipse Juno/NDK R8D/OpenCV 2.4.4
Project folder has this red exclamation mark but no files within are showing any errors.
CDT builds the app just fine!
Here's what LogCat gives me:
Any clue? Cheers
EDIT:
after I followed your advise I ended up with the following:
Description Resource Path Location Type
Project 'OpenCV Library - 2.4.4' is missing required library: 'C:\Program Files (x86)\Android\android-sdk\platforms\android-17\android.jar' OpenCV Library - 2.4.4 Build path Build Path Problem
The container 'Android Dependencies' references non existing library 'C:\Android\android-opencv-2-4-4\sdk\java\bin\opencv library - 2.4.4.jar' Test1 Build path Build Path Problem
If the project folder is showing a red exclamation mark, try going to window > show view > problems and there may be a better description there of any problems.
The log above looks like a general log from your device. If you want to log from a specific running application, run the app on a device from eclipse and type app:com.yourpackagename in the text field above the LogCat output.