Error after building a testcpp Eclipse Project - android

I am trying to build and run a test project for android following this guide :
"http://www.cocos2d-x.org/wiki/Setting_up_Android_Development_Environment_on_Mac_OSX#Get-the-NDK"
The specific problem is after building the Test demo in eclipse which is called "TestCpp"
which has another project linked to it "libcocos2dx" i get an error stating:
make: *** [obj/local/armeabi/objs/cocos_extension_static/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.o] Error 1
This is what the console displayed through the build process:
**** Build of configuration Default for project TestCpp ****
bash /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/build_native.sh
NDK_ROOT = /Users/mohammadbaroudi/Downloads/android-ndk-r10
COCOS2DX_ROOT = /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../..
APP_ROOT = /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/..
APP_ANDROID_ROOT = /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android
Using prebuilt externals
Android NDK: WARNING:/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
make: Entering directory /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android'
[armeabi] Compile++ thumb: cocos_extension_static <= LabelReader.cpp
/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../extensions/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.cpp: In member function 'virtual void cocos2d::extension::LabelReader::setPropsFromJsonDictionary(cocos2d::ui::Widget*, const Value&)':
/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../extensions/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.cpp:54:9: error: 'transform' is not a member of 'std'
std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper);
^
make: *** [obj/local/armeabi/objs/cocos_extension_static/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.o] Error 1
make: Leaving directory/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android'
**** Build Finished ****
Now I checked the file path and it pointed to a non-existing obj file "LabelReader.o", the strange thing is that in the "/WidgetReader" folder "mentioned in the error above", there are multiple reader folders e.g:"ButtonReader,CheckBoxReader,etc" all with accompanying ".o" & ".o.d" files with the same names except for the LabelReader folder which is empty.
I tried to exclude the "LabelReader.o" file from the build process through right clicking on the file in eclipse and excluding it, but the same error occurred and I tried to right click on the error in the problems tab and hit "fix" which notified me that it cant fix it.The last thing that came to mind was excluding the "LabelReader.o" file from compilation through modifying the makefile itself, where its discussed here:
Makefile. How to exclude one particular file from compilation?
But there seemed to be multiple methods of doing so, and still i am not sure i completely understand whats wrong other than there is a missing file thats being complied but can't be built.I am sorry if this question is too big and it also is my first question here so excuse me if i wrote a lot.

add this line in file where error occurred
#include <algorithm>

Related

Can't read proguard.ClassPathEntry unexpected EOF

I am trying to build cubieboard 4 AOSP source (version 4.4. I think it has nothing to do with Cubieboard). But I am getting errors related to proguard: Error: Can't read [proguard.ClassPathEntry#5f893efe] (unexpected EOF)
build/core/java.mk:435: recipe for target 'out/target/common/obj/APPS/Camera2_intermediates/proguard.classes.jar' failed
In fact I was able to build complete source without errors previously. But don't know all of a sudden how come this error started appearing.
I have gone through link Android Proguard java.io.IOException, though this is related to file not found and mine is unexpected EOF (End of file); and have already tried below things:
Deleting complete out folder and then doing $make -j4
sourcing envsetup.sh $. build/envsetup.sh
Replacing original proguard tool(4.7) with latest (5.3.1)
I can comment particular PRODUCT_PACKAGES from /build/target/product/sdk.mk etc for which proguard error was coming. But finally came across error for Camera2 which is absolutely needed for my application and cannot be commented.
Anybody came across this and found solution? Please Help!
DETAILED LOG with proguard 5.3.1:
Reading library jar [/home/osboxes/Project/Semapresence/cc-a80/android-fresh/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar]
Reading library jar [/home/osboxes/Project/Semapresence/cc-a80/android-fresh/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar]
Error: Can't read [/home/osboxes/Project/Semapresence/cc-a80/android-fresh/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar] (unexpected EOF)
Error: Can't read [/home/osboxes/Project/Semapresence/cc-a80/android-fresh/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar] (unexpected EOF)
build/core/java.mk:435: recipe for target 'out/target/common/obj/APPS/DeskClock_intermediates/proguard.classes.jar' failed
make: *** [out/target/common/obj/APPS/DeskClock_intermediates/proguard.classes.jar] Error 1
make: *** Waiting for unfinished jobs....
build/core/java.mk:435: recipe for target 'out/target/common/obj/APPS/Camera2_intermediates/proguard.classes.jar' failed
make: *** [out/target/common/obj/APPS/Camera2_intermediates/proguard.classes.jar] Error 1
Answering my own question. Hope it can help other who faced similar issue:
I could temporarily solve my problem by disabling proguard for particular module for which it was giving error.
To do this added below line to Android.mk
LOCAL_PROGUARD_ENABLED := disabled

Android NDK - Building Limbo Android returns fatal error: config.h: No such file or directory

I'm trying to rebuild Limbo Android. I'm on Linux Mint.
All I changed was android-config.mak NDK_ROOT, exported variables NDK_ROOT. I've also exported NDK_MODULE_PATH to /home/pathtoandroidndk/sources, as per README instructions.
From terminal I do cd limbo-android/jni and then make.
Building returns this error:
jni/glib/glib/./libcharset/localcharset.c:22:20: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs-debug/glib-2.0/./libcharset/localcharset.o] Error 1
make: Leaving directory `/home/me/limbo-android'
I've tried modifing Android.mk following instructions from Android NDK - Additional Include Directories and Unable to find header files - Android NDK, without success.
I came to conclusion that each module inside limbo-android needs it's own config.h file, while libcharset does not have one.
How do I solve this error? Is there a generic config.h (the one from NDK maybe?)
NOTE: I can build it without any problems on Windows 8.1 using mingw.

setting Android NDK giving error : Your APP_BUILD_SCRIPT points to an unknown file

I'm running a sample application given in android-ndk, i have done basic settings like setting NDK Path at windows->preferences->android->NDK . Adding native support into project, included directories at c/c++ genereal-> paths and symbols -> includes but project is still showing error , if i clean the project it will generate error shown below . Any one knows what this errors means and what is the solution for this?
**** Clean-only build of configuration Default for project HelloJni ****
F:\android-ndk-r9-windows-x86\android-ndk-r9\ndk-build.cmd clean
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ;F:\android-ndk-r9-windows-x86\android-ndk-r9/jni/Android.mk
F:/android-ndk-r9-windows-x86/android-ndk-r9/build/core/add-application.mk:176: *** Android NDK: Aborting... . Stop.
**** Build Finished ****
Seems like ndk-build looks for jni/Android.mk under NDK directory and it is clearly wrong. Before running ndk-build, you should change your directory to project directory. For ease of use, add NDK directory to Path in your environment variables first, then change your directory to project directory and run ndk-build then. Like (assuming NDK directory is added to environment variables):
cd F:\path\to\project
ndk-build

FFTW Build Android

I just follow this sophisticated and nice manual
compiling fftw3 in android ndk
I succesfully build config.h file but in this next step with Android.mk:
IAm stack becouse I try build this and Console says:
12:53:23 **** Incremental Build of configuration Default for project F ileBroswerActivity ****
sh "C:\\Users\\Peťulka\\Desktop\\android-ndk-r5b-windows\\android-ndk-r5b\\ndk-build" all
Invalid attribute name:
package
/c/Users/Peťulka/Desktop/GUI/FileBroswer/jni/Android.mk:2: /fftw3/project/jni/Android.mk: No such file or directory
/c/Users/Peťulka/Desktop/GUI/FileBroswer/jni/Android.mk:2: /fftw3/project/jni/Android.mk: No such file or directory
make.exe: *** No rule to make target `/fftw3/project/jni/Android.mk'. Stop.
12:53:29 Build Finished (took 6s.316ms)
But I have this ANdroid.mk file ! in this path I check my project 10 times, I dont know where i s problem.,

trying to build webkit from android externals

I've been trying to build Android WebKit from source (from here https://github.com/android/platform_external_webkit), but haven't had any success so far. I've run make and ndk-build from the root directory of my repo copy and from from the Source directory inside it, with the following results:
make from the root directory (makes sense, because there is no Makefile),
make: *** No targets specified and no makefile found. Stop.
make from the /Source directory:
make[1]: Entering directory `/webkit/Source/JavaScriptGlue'
../Makefile.shared:2: ../../Makefile.shared: No such file or directory
make[1]: *** No rule to make target `../../Makefile.shared'. Stop.
make[1]: Leaving directory `/webkit/Source/JavaScriptGlue'
make: *** [all] Error 2
ndk-build from root and ./Source:
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
<NDK>/build/core/build-local.mk:130: *** Android NDK: Aborting . Stop.
Can anyone advise as to what I'm doing wrong? I've read mention of Android needing to be compiled as a whole, but since this is 'external', I thought it would compile standalone. Am I wrong about that? Or is there some configuration step I've missed? Or anything else?
Thanks for the help.
This doesn't allow you to get a build fully working, I suspect you did the same as me and cloned to a folder called webkit.
If you rename that to jni and then run ndk-build from the folder containing jni, it does at least get past the problem you mention. I now get the error:
jni/Android.mk:314: external/stlport/libstlport.mk: No such file or directory
Android NDK: Trying to define local module 'webcore' in jni/Source/WebKit/Android.mk.
Android NDK: But this module was already defined by jni/Source/WebKit/Android.mk.
/cygdrive/e/android-ndk-r7/build/core/build-module.mk:34: *** Android NDK: Aborting. . Stop.
I'm still trying to figure out how to solve this new error.

Categories

Resources