I am trying to run an OpenCV4Android in my eclipse. I am working on Linux(CentOS 6).
I have done everything mentioned in this link but I am still getting build errors. I have also set the NDK path in preferences hat is not mentioned in the tutorial and tried a lot more things. When I try to build the library project the console gives:
"Cannot run program "/ndk-build": Unknown reason
Error: Program "/ndk-build" is not found in PATH"
All the projects also have build errors and the src and gen folders in openCV4 Library is not created and the build path shows:
"Unable to get system library for the project"
When i try to change the project properties I get an error saying the page contains invalid values and I cannot change the android api version. Plz help. Have been trying to set this up since 3 days now.
Thank you.
First Clean and Build you library Project alone and then try cleaning all your projects. In order to solve the "Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH" error, Try the following steps:
Head to the project's properties. If you're using Windows, the shortcut is Alt + Enter; or simply right-click the project name to find its properties.
Go to the C/C++ Build section; under Builder Settings tab in Build command: text box you're likely to find something similar to that below, if it's empty then type in the similar text - namely: ${NDKROOT}/ndk-build.cmd where NDKROOT, as its name implies, refers to the path where your NDK root folder exists.
Now you must inform eclipse what NDKROOT equates to; as in, where is the NDK root path. You can do this by heading to (in your project's properties) C/C++ Build > Environment > press Add…
Now add your environment variable named NDKROOT (the Name) with the relevant path (Value). Note that you're to repeat this per NDK project. You would get a window similar to that below.
Press OK to the New variable input window and then OK again to the properties window.
Hopefully this will help!
Related
I have started learning Coco2d-x and want to run the sample app on my android phone. I have imported sample project Hellocpp in my eclipse and fixed the library path. I am able to install it on my device but when i run it i get below error.
I am following this tutorial: coco2d-x
Please help me out.
Are you sure you have the linked the source cocos library to your project in the java build path. and if so. please check your environment variables for COCOS2DX_ROOT,NDK_ROOT.
1: In Eclipse, right-click on your project and select the last option "properties".
2: In Project Properties window, select "Java Build Path" in the left pane.
3: Under Java Build Path, select tab "source". It should be selected by default.
4: Click on button "Link Source"
5: Browse it to following location-> COCOS2D-X_INSTALLATION_FOLDER/cocos2dx/platform/android/java/src. My path will be: E:\cocos2d-x-2.2\cocos2dx\platform\android\java\src
6: Give any folder name. For example, remove src and replace it with: Cocos2d-x-source. Click Finish.
We are done now. Run your poject on an Andorid Device and it should show you the nead cocos2d-x logo. Please note that running this in an Android Virtual Machine may not always work.
If there is an error after the project has been imported and build like:
Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml eclipse
You can change the Eclipse settings by following these steps, provided by a someone from Google (at this link) (but also, see my IMPORTANT note below):
IMPORTANT! What the Google guy didn't note is that you also need to use the "Move Up" button in the settings to move your new rule to the top because otherwise some other more generic rules overshadow it and it doesn't work.
In eclipse:
Window -> Preferences -> C/C++ -> Build -> Settings
Select CDT GNU C/C++ Error Parser
In the Error Parser options at the bottom, add a new entry with the following contents:
Severity: Warning
Pattern: (.?):(\d+): Android NDK: WARNING:(.)
File: $1
Line: $2
Description: $3
I am getting the errors:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'DashboardActivity'.
java.lang.NullPointerException
and
[2013-09-02 17:55:31 - DashboardActivity] Project has no project.properties file! Edit the project properties to set one.
and
Description Resource Path Location Type
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files UserFunctions.java /DashboardActivity/src/libary line 1 Java Problem
and
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project DashboardActivity Unknown Java Problem
I have already tried cleaning the project and I get the same errors. Only the 'DashboardActivity' project is the one getting this error and my other projects work fine. In my properties Order and Export section there is a part that says "Unable to get system libary for this project"
I know there should be a proper android.jar file here but I don't see one.
Also, the android tools 'fix project properties' does nothing at all when I click on it.
I have the AndroidManifest.xml file as well.
Ever since I first went to clean my project it has created the file "proguard-project.txt" as well.
What can I do to fix this? Thanks in advance!
NOTE: now I can't acess the gen folder or bin folder (there is no little + for me to click on to open it) and now it's saying that R cannot be resolved to a variable) ???
Error while applying
Why don't you do this
Right click on Project Root folder > properties > Java BuildPath > Library Tab
Check whether any of library is missing (showing error with red cross)
if yes then add this library to your project
don't forget to CHECK it on Order and Export
Do one more thing
Right click on Project Root folder > properties > Android > set your Project Build Target
check any one target
Check your Android-sdk path from
Window > Preference > Android
I was also having these errors:
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object.
and
The Project Properties Order and Export section has an error "Unable to get system library for this project"
I solved it by Right Clicking on the Project Root folder > properties > Android > set your Project Build Target and changed it to the highest target I could trust from working on other projects.
It has been 3 years since I had this project working. So I noticed when I was troubleshooting tonight, that the manifest did not have a targetSdkVersion, only a minSdkVersion of "8". So I had changed that to this:
After doing the above 2 things, all my errors were gone -- however (!) ... a bit later tonight, I was trying to export my project to an .apk. And Eclipse crashed. Upon re-opening it, Eclipse is super broken. I am about to do a re-boot my PC now - and thus need to finish posting this. I trust Eclipse will be back to normal. But the reason I am mentioning this is that I suspect I may need to re-install Eclipse as I have been getting other minor start-up errors when I open Eclipse. And the errors I had tonight in that app were very strange and unusual.
I am new user of Android Studio and I have serious problem with trying to import Android Studio project to Android Studio on other PC. In general, my Gradle doesn't want to build the project and it is caused by problem with path.
Error log:
Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Build file 'E:\Projects\MenuMenu\EventGame\build.gradle' line: 1
A problem occurred evaluating project ':EventGame'.
A problem occurred evaluating project ':EventGame'.
The SDK directory 'E:\Program Files (x86)\Android\android-studio\bin' does not exist
My Android-Studio SDK is in directory:
E:\Program Files (x86)\Android\android-studio\sdk
I found from various posts with similar problems that you can change path to sdk in local.properties file. Mine looks currently like that:
sdk.dir=
So it's empty, but still default path is SOMEHOW set to "E:\Program Files (x86)\Android\android-studio\bin" and I have no idea how to change it. If i try to add to sdk.dir real path the error is the same but the path in error looks like that.
The SDK directory 'E:\Program Files (x86)\Android\android-studio\bin"E:\Program Files (x86)\Android\android-studio\sdk"' does not exist
In 90% of causes I could find via the net people were solving the problem by adding: sdk.dir=/Applications/Android Studio.app/sdk
But then directory is set to E:\Program Files (x86)\Android\android-studio\bin\Applications\Android Studio.app\sdk and something like that doesn't exist in my PC.
Do you have any idea how to solve this problem. Is there any way to change this default path? I also get error:
E:\Projects\MenuMenu\EventGame\build.gradle
Gradle: A problem occurred evaluating project ':EventGame'.
> The SDK directory 'E:\Program Files (x86)\Android\android-studio\system\compile-server' does not exist.
Thats how my folders looks like:
https://www.dropbox.com/s/ikj63gmyfax8z4u/folders.png
The easiest and imho the cleanest way to do this is not to set the directory by code, but with an enviroment variable in Windows:
Press Win + Pause Key together to see the system information
Click on Advanced systems settings (or similar..i don't know the exact english translation)
Select the Advanced Tab and on the bottom click on "enviroment variables"
Another window pops up where you click on the "New..." Button in the lower half of the window (The system variables area)
Name the Variable ANDROID_HOME and paste the path to your SDK as value (in your case E:\Program Files (x86)\Android\android-studio\sdk)
save and close everything
If you have a command line window open then close this as well and reopen cmd.exe if you want to use ANDROID_HOME within the command line.
Okay in general problem was caused by the fact that the project was imported from Android-Studio installed on Mac. The slashes were in oposite direction, and somehow program couldn't override default direction because he couldn't understand the path.
On the bottom right there is a display type icon, click on that then click gradle on the left side, then refresh it by clicking on the icon. You should have net connectivity. It will download a small file, about 50kb. This works for me.
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.
If I run my project this error will come build path problem how to solve this error.
error:
Description Resource Path Location
Type Project 'videothumb' is missing
required source folder: 'gen'
videothumb Build path Build Path
Problem
The project cannot be built until
build path errors are resolved
videothumb Unknown Java Problem
Can any one help me?
Try to clean project and if it still doesn't help close and then open project.
IF you are using eclipse then do as follows:
right click your project.
select build path-->configure build path.
update all the broken links in all 4 tabs.
Go to project-->clean [project will be found at top menu of eclipse.]
Clean your project.
Its done. For any further explanation comment on my answer.
Hope this helps.
Edit:
Here you go:
As you can see i'm at source tab of configure build path and i have only one folder here named ATalk/Src. likewise you can have number of folders.
Check for red cross mark on folder. if its there then your folder path is wrong means link is broken for that folder.
Same way you can check in Libraries tab. There you will find list of jars in your project. If any of them have red cross then its path is missing. So update all such red cross paths.
As you can see i dont have a red cross on my folder means it is at correct location.
Hope you get my point.
EDIT:
I just noticed that, according to your screenshot, the problem seems to be that the adb tool is not found. Now I might be wrong but I think that as of Android 2.3 (maybe even earlier) the adb tool is expected to be in [path-to-your-sdk]/platform-tools folder, not in the [path-to-your-sdk]/tools folder. The later path was used in earlier SDK's and your problem might be caused by such a simple thing that you have an outdated Android plugin in Eclipse.
OLD, IRRELEVANT ANSWER:
I've seen these kind of issues in Eclipse environments when I have some kind of error in my XML files. Malformed errors (that violate the rules of the XML structure) are often treated as "syntax errors" and are shown directly when you write them or when you try to build your application.
Other errors, however, like giving invalid references (giving a dimension where an integer is expected, for example) are not always highlighted with file name and failing line number (I'm not sure if this is bug in Eclipse's android plugin or even if it's a bug at all).
These kind of errors you'll have to hunt down manually and rebuild your project (as dcave555 sugested). This is really boring work if you have many XML files with many changes in
I think the path should look like this: /home/embdes/projects/android/android-sdk-linux_86
The problem is because of your Android build path settings. Try to check:
Window > Prefereces > Android > Build path
it should properly set to your Android SDK