Program "g++" not found in PATH - android

i have problem when add openCV native C, to my project. first it just say
"Program "g++" not found in PATH"
"Program "gcc" not found in PATH"
but when I right click on my project --> Android Tools --> Add Native, I got more error, this is the error:
and this is what the console say:
I have no idea what should I do? someone can help me?
And This the program that I use:
- OS Windows 7
- Eclipse Juno
- OpenCV 2.4.5

If your IDE is eclipse,you must reset to the default settings. You can do it as following:
1- open Eclipse->Windows->Preferences->C/C++->Build->Settings
2- You will find, under the 'Discovery' tab, two options: [reset] or [restore defaults] the 'CDT GCC Build in Complier Settings [Shared]' or all settings.

Related

coco2d-x: java.lang.IllegalArgumentException: Unable to find native library

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

Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException

I am getting following exception when I am trying to run my Android project.
Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException
Currently now I am using ADT version 22.3. My project target is API level-15. I tried to add Support library in Android tools, but problem not resolved.
the key is to set target=android-19 from project.properties and android:targetSdkVersion="19" same to 19. This has worked for me.
Its a big mess... Following way did the trick for me...
Right click your project in eclipse -> Android Tools -> Add Support Library
Then click Accept License and click install.
I had the same problem and I used these methods
1- Downgrading to Android SDK build tools 18.1.1
2- Adding the support library. (if it already there, try removing it and adding it again, Right click on project -> Android tools -> Add support library)
you can follow the detailed instructions here
http://techlovejump.in/2013/11/how-to-solve-unable-to-execute-dex-java-nio-bufferoverflowexception-check-the-eclipse-log-for-stack-trace/
Link above is broken but provides valid solution. Updated link: http://techlovejump.in/how-to-solve-unable-to-execute-dex-java-nio-bufferoverflowexception-check-the-eclipse-log-for-stack-trace/
Is this the same problem as Android dex gives a BufferOverflowException when building ? Updating to the 19.0.1 Build-tools (as described in the linked post) fixed this problem for me.
Browse through your eclipse Folder->
Open Eclipse Folder
Open eclipse.ini
Change -Xms40m And -Xmx384m TO -Xms512m And -Xmx512m
Click Save
No need to downgrade.
You can fix the error by editing the manifest file or project properties. Add following line.
sdk.build.tools=18.1.1
replace 18.1.1 with your targetsdk in manifest.
Step by step detail on :- http://techlovejump.in/2013/11/how-to-solve-unable-to-execute-dex-java-nio-bufferoverflowexception-check-the-eclipse-log-for-stack-trace/
I Update the project.properties file. I put sdk.build.tools=19.0.1 in property file. And set the minimum SDK version to 14
it happened to me when my emulator had set a high Ram value, i changed the emulator RAM value to 768 and then it worked
I've dealt with this problem when using Sherlock ActionBar library in my project.
You could do the following step, it's work for me.
Right click to your project, select properties.
A dialog will show up, select 'Java build path' on the left menu.
Remove 'Android dependencies' and 'Android private libraries' on the right panel then click OK
Clean your project (select menu Project --> Clean)
Right click your project, select Android Tools -> Fix project properties
Clean project once again.
Restart your computer
Open eclipse and Export apk
Hope that will help you.
I was having redundant libraries in my IDE that was causing an issue none of the other solution worked for me

Error: Android source build in eclipse

While trying to add android source to eclipse, I am getting the following errors.
Project 'android' is missing required library: 'out/target/common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar'
Project 'android' is missing required library: 'out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar'
FYI, I have built the source successfully with full_maguro-userdebug configuration (for Galaxy Nexus) before adding this to eclipse. Since I couldn't find "create project from existing source" in Eclipse Indigo, I changed the location of the project to the root directory of the source. I refreshed the project several times with same error.
How to solve this issue?
You should go to Project -> Properties -> Java Build Path.
There open tab Libraries.
In this tab out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar should be changed to out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar by selecting javalib.jar from google-common_intermediates, pressing Edit and selecting instead android-common_intermediates.
Entry with gsf-client_intermediates javalib.jar can be simply deleted.
A more comprehensive answer at here: https://groups.google.com/forum/?fromgroups=#!topic/android-platform/XIbR8ZKe7Tw
I would not recommend using eclipse for android source. Android is not a single project and it too big for an IDE like eclipse to handle.
Use simpler plain text editors like vim, emacs to browse the code

error when importing android projects into eclipse

currently i have difficulties trying to import the lynda.com android app development with java essential training exercise files into eclipse. I keep getting some java errors like this.Can someone help me out with this problem?
Currently im using
Android SDK r12
ADT 12 plugin for eclipse
JDK 7x64
JRE 7x64
LEclipse IDE for Java Developers 3.7 indigo
here's the error:
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.
The type java.lang.Object cannot be resolved. It is indirectly
referenced from required .class files
(original screenshot below)
A little late on this, however after struggling with the issue myself I found a solution to the problem.
Right Click on the project --> Build Path --> Configure Build Path...
In the 'Source' tab, Select the project eg. 'myProject/src' --> Click OK.
Right Click on the project --> Android Tools --> Fix Project Properties
That should do it!
Have you tried changing your compiler to Java 5 instead of Java 7?
Also make sure that in the project settings that you're using Java 5.
Ryan,
I had the same problem and it was corrected by going to the project preferences(right click project -->preferences). Then go to "java build path" and click on the libraries tab. Look for your JRE lib in the list. In my case the system was unable to find it, but the entry was still there. Delete this and add a new one by clicking "add library" and select JRE System library. Then select the default system lib. Close out of the preferences window and then Right click on your project and go to android tools-->Fix project Properties. Clean your project and try building again.
This works
Project > Properties > Android > change the Build Target

Failed to load properties file for android project

I finally was able to build and debug the android platform with this tutorial. I imported my project in eclipse, and afterwards installed ADT. Then I converted my imported project to android project (Android Tools -> Convert To Android Project). And now I'm having Failed to load properties file for project 'droid-platform' error. Session data:
eclipse.buildId=M20100211-1343
java.version=1.5.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=ru_UA
Command-line arguments: -os linux -ws gtk -arch x86
Does anyone know, how do I deal with this?
Use the contextual menu on the Project in error, "Android Tools"-->"Fix project properties", I also tried "Refresh (F5)" in the same pass, than it worked again.
ADT does not work good with the platform itself. Actually, the platform is not an android project itself.
I really struggled with this one and finally solved it using the solution here:
"Debug certificate expired" error in Eclipse Android plugins
I also had the error message you mention, but somehow, deleting the keystore fixed everything.
p.s. do a clean after deleting the keystore.
Yusuf
The solution to this problem is to setup some System Environment Variables.
Right click on "My Computer" and select "Properties"
Select the "Advanced" tab
Click the "Environment Variables" button
Under "System Variables" find "Path", select is and then click "edit"
Scroll to the far right, now you need to add two paths, "C:\Documents and Settings\YOUR_USER_NAME\.android\avd" and "C:\Program Files\Java\jdk1.7.0_01\bin", you need to add a ; at the end of each path. Click "Ok" when done.
Select the "New" button, for variable name enter "ANDROID_SDK_HOME", and for variable value enter your SDK install path (Default is "C:\Program Files\Android\android-sdk") and then click "Ok"
Restart Eclipse and it should work!
on my mac, with Eclipse and the Android AVD exited,
1) i deleted all projects in my workspace (backup first!),
2) recreated it with the same workspace name and
3) finally restarted eclipse and a new project setup works fine without the "Failed to load properties.." msg.
So easy just choose the project that has an error, and then go to menu>project>build Project
Just create a new file called project.properties in the root of your project.
Add the line:
target=android-10
Or modify it to whatever version of the Android you're targeting.
I got the a similar error When following the Notepad tutorial on the Android Developers website, the first step in Exercise 1 is to create the first project by going to
File->New->Android Project-> "Create project from existing source"
The problem is that when you select the Notepadv1 path to create the project from existing source, Eclipse will take the project out of the parent folder and move it up a level. For example, if you select
C:\workspace\NotepadCodeLab\Notepadv1
... as the existing source, Eclipse will copy all the contents of that subfolder except the AndroidManifest.xml (and Android.mk file) into a new folder one level up, eg.
C:\workspace\Notepadv1
So one workaround is to create the project, close Eclipse, then copy in all the missing files from the old subfolder to the new folder, then open Eclipse again and refresh the folder.
Presto, no more missing files.
In my case, I just add to import the R.java (ex:import com.exercise.teste.R;) to my class files by right clicking on ex: R.id.mybutton and choose import ex; your.package.name.R, then CLEAN, BUILD.
What fixed the problem for me was going into eclipse sdk manager and installing the tools there even though I had them installed on my sdk manager. It seems that there 2 separate sdk managers with different files, so try directly going into the sdk manager in Eclipse and seeing if you have the tools installed there.
I had the same problem, and without installing AUSKey only corrected the error by removing the log4j.jar / Library / Java / Ext on Windows (\C:\Program Files\Java\jre7\lib\ext) was fixed. In my case, the solution was like this:
https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=54452
I had this error when I manually tried editing the manifest file, "AndroidManifest.xml". When I made changes using the little GUI provided for editing the file, it works fine.
Make changes via the Manifest General Attributes and Manifest Extras sections that opens up when you double click the "AndroidManifest.xml" file. Yet beware of changes made directly to the xml, even if they are identical!
I was facing the same issue but I finally got the solution:
Right-click on your Eclipse project.
Go to Build Path->Configure Build Path->select Android from left side.
In Library section select and remove the existing v7 library
Add it again from your imported v7 project.

Categories

Resources