I'm developing an application for Android using cocos2d-x. I'm new to cocos2d-x and C++ and I'm on windows, I have followed due process from creating the Cocos2d-x project template for Eclipse to importing the project into Eclipse and adding c++ features to it etc... I succesfully got my app to run in the emulator(target API 4.1) and it gives me the cocos2d "HelloWorld Splash" as expected. Problem is, now I'm trying to change my Application background image. I added an image in the assets directory and changed the code in "HelloWorldScene.cpp" that creates the default HelloWorld Sprite
from:
CCSprite* pSprite = CCSprite::create("HelloWorld.png");
to:
CCSprite* pSprite = CCSprite::create("background.jpg");
Once I do the latter, my emulator crashes after trying to run the App and in logcat I get the error "Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)", but if I put back the default HelloWorld.png it runs again smoothly in the emulator.
I use cocos2d-2.0-rc2-x-2.0.1 and android-ndk-r8b. This App runs only on a 4.1 API device emulator, I can't get it to run on 2.3.3 and 4.3 as it crashes while trying to run. Please, kindly help me out please
I think you might forget to run the build_native.sh script to update the libgame.so
Stick to png image format.
Make sure that your image is copied to
assets directory on android project.(This happens automatically if
you have the image in Resources directory).
Try troubleshooting your image.
Take the "HelloWorld.png" and modify it in whatever image editor you use. If it works then you know it's not your editor.
Try making your background image the same size as "HelloWorld.png" and in PNG format with the same default settings as "HelloWorld.png"
Also ensure that the "HelloWorld.png" is in your Assets directory, if not you may need to add the Assets directory to the search path via CCFileUtils
Good Luck!
Related
I am using Delphi 10.2 Tokyo. I want to develop on my new Android Pixel. After installing the necessary programs, etc, I try to compile a simple "Hello World" program, but always gets this error message:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\19.0\CatalogRepository\AndroidNDK-9c_x86\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: fatal error: .\Android\Debug\libAndroid_Test_Proj.so: open: Permission denied
Are there any solutions?
My problem was solved my moving my project folder from the above mentioned location to a folder directly in the root (c:\mobiledevelopment).
I have tried something like this before. I had a sqlite database located in the debug folder of my default project folder. I got an error telling me that the database was locked. When I moved the databse to a folder in the rootdirectory (c:\sqlite) the problem was solved.
An explanation of this would be most wellcome!
Best regards
Lars
AOSP (android 8.0.0-r3) for Pixel XL, Im trying to stop Android from loading nfc_nci.marlin.so by
removed nfc_nci.marlin from device-marlin.mk
removed the source from system/nfc/halimpl/pn54x
After rebuild and flash to phone, I still notice from logcat :
sphal namespace is not configured for this process. Loading
/vendor/lib64/hw/nfc_nci.marlin.so from the current namespace instead.
Since I did not build nfc_nci.marlin.so, I did a search and found a hit in vendor/google_devices/marlin/proprietary/vendor.img. How can I stop the AOSP from loading this share library from vendor image??
Don't know if you have the same device tree as me, but you have to remove nfc_nci.marlin.so from PRODUCT_COPY_FILES in vendor/google/devices/marlin/marlin-vendor-blobs.mk, then manually from out(..)/vendor/lib(,64)/hw/ and rebuild the AOSP
Being new to Android NDK Caffe, I would like to use built version in my Android project. I tried to run this built sample demo, but while running, it showed the following:
03-26 14:46:35.697 2800-3042/com.sh1r0.caffe_android_demo A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 3042 (AsyncTask #1)
(the app crashed)
I can see that the sigsev signal is thrown through android AsyncTask.
The problem could come from this function.
caffeMobile.predictImage(strings[0])[0]; //line 160 of MainActivity
This signal comes from JNI and it is very difficult to know where is the problem unless you can debug natively (through ndk) the app. The caffe-sample is not configured to debug on native method.
Try this issues to manage the error:
Ensure that your image path in this string[0] arrays are not empty. and exists.
Ensure that the other caffeMobile functions are able to exec without
problems, for example:
caffeMobile = new CaffeMobile();
caffeMobile.setNumThreads(4);
caffeMobile.loadModel("/sdcard/caffe_mobile/bvlc_reference_caffenet/deploy.prototxt", "/sdcard/caffe_mobile/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel");
If you are able to execute the other functions, probably your image path is not correct, check.
If you are not able to execute loadModel or setNumThreads function, probably the apk is not loading libjni.so library correctly , or the jni bridge is not able to locate jni functions.
I try to figure out some problem caused by thread sync in mips android, I installed valgrind in my mips machine, It is ok when using memcheck, but when I changed the option to --tool=helgrind, logcat says this:
I/start_valgrind.sh( 9328): link_image[2207]: 9329 could not load needed library '/data/local/Inst/lib/valgrind/vgpreload_drd-mips32-linux.so' for '/system/bin/app_process' (mips_relocate_got[1749]: 9329 cannot locate 'sched_yield'...
I located sched_yield in /system/lib/libc.so, but I can't find a way to add it to the link path; I using valgrind-3.10.0 and my android system version is 4.1.
So is it possible to run helgrind/drd in android? Thanks!
I installed the extensions and created the new project based on Installed/Templates/Other Languages/JavaScript/Muti-Device Hybrid App/Blank App (Apache Cordova)
I selected Android as the platform.
I selected Ripple - Nexus 7 (Tablet) as the debugger and pressed F5 to compile and run.
It errors out with the following error: "Error 2 ENOENT, no such file or directory 'C:\Users\C.cordova\lib\android\cordova\3.5.0\VERSION' C:\DATA\SOURCE\AllSoc\AllSoc\EXEC 1 1 AllSoc
The project is called AllSoc.
Does anyone have any idea how to get unstuck from here. From all the documentation and videos I've seen, this part SHOULD just work.
Thanks in advance.
Per Ellen's (https://stackoverflow.com/users/3912411/ellen) suggestion above, I deleted the C:\Users\C.Cordova folder's contents and then reran the project. This time around it worked as expected.