How to build Android NDK sample: "bitmap-plasma" - android

I am trying to build the bitmap-plasma sample that is included with the ndk, but getting an error. I run ndk-build from the samples/bitmap-plasma directory, and the error it displays is that it cannnot locate android/bitmap.h file.
How do i direct the ndk-build script to the file it needs?
Using android-ndk-r4 on Ubuntu Lucid 10.04

Well it's working now, so in case anyone was having my same problem:
There as an android-ndk-r4b bugfix release today, which it seems no longer has this problem.
Available to download here.
http://developer.android.com/sdk/ndk/index.html

With Ubuntu 10.04 and NDK r5b, I have just posted a bug report (with the fix included) for build_platforms.sh. See http://code.google.com/p/android/issues/detail?id=15180 for details. Essentially, the local declarations in the symlink routine must be amended. Otherwise, it only links the first file (alphabetically) from each directory, and truncates the remainder from the list.
Correcting this allowed the symbolic links to be fully populated, thereby filling in the missing header files and libraries and allowing the samples to build successfully.

Related

Can't mach build Fennec for Android

i'm following this tutorial from firefox android source code https://wiki.mozilla.org/Mobile/Fennec/Android
but, the problem i can't ./mach build, ./mach package, ./mach install and i already create .mozconfig file in mozilla-central but it's can't found the file.
like this:
i'm using Ubuntu 14.04.2
thx for help
You probably had an error during the initial "mach bootstrap" step. Your screenshot tells us, that mach can't find the android sdk tools. It's looking for them under ~/.mozbuild/android-sdk-linux/.
One thing you could do is to manually put your sdk under that directory and then retry "mach bootstrap" from the source dir to resolve the remaining dependencies.
Also see these steps for manual setup of the build tools: https://wiki.mozilla.org/Mobile/Fennec/Android/Detailed_build_instructions

ERROR: '__NDK_FPABI__' does not name a type. Version 2

I have exactly the same problem described here ERROR: '__NDK_FPABI__' does not name a type but I don't understand the answer or I am doing it wrong; I need more details.
This is my enviroment:
Trying to compile a .so (thridparty) in order to use it in my Android app. This is a standalone lib, not in any Android project (not in project/jni)
Host OS: Ubuntu 12.10 x86
Android NDK version r9d
What I have done is:
Open lib.so's Makefile -> change paths to /usr/include to $NDK_HOME/platform/android-9/arch-arm/usr/include (in previous link, I don't understand the meaning of "Android makefile")
Add LOCAL_CFLAGS += -save-temps
So, I don't understand the meaning of "Android makefile" in this standalone lib and where to search (and what to look) the *.i *.ii *.s files
Any help? Thank you
P.D: I would like to comment in related topic but I don't have enough reputation. Sorry
I have solved the problem linking header file (sys/cdefs.h) from $NDK_HOME/platform/android-9/arch-arm/usr/include/sys to $NDK_HOME/platform/android-9/arch-arm/usr/include
and changing the source file that launches the error from #include <sys/cdefs.h> to #include <cdefs.h>
Sure there must be better solution, but this was enough for me.

Error: Program "/NDK-build" not found in PATH

I need help. I'm trying to install and configure OpenCV 2.4.7 library in my computer (Ubuntu 12.04). After run OpenCV samples appears those errors in my Console:
Cannot run program "/NDK-build": Unknown reason
Error: Program "/NDK-build" not found in PATH=[/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]
I've seen numerous tutorials and nothing worked. I ask you to be very specific since I am "new" programming and also because my mother tongue is not English (I have some difficulties). Thank you!
Easiest Method which worked for me is.
Goto the Project Properties
Click on C/C++ Build (An other list will open)
Click on the Environment from the list
Now click on Add
Here you have to Put 2 values
Put Name as NDKROOT
In Value put PATH TO THE NDK FOLDER
You are done :)
Same case happened with me (when my NDK location was already set), so changing to original Android Builder removed my problem for doing so simply go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.
Do you have android-ndk installed? If yes, add path to ndk-build to your path.
e.g:
export PATH=$PATH:~/android-ndk/bin
Add the ndk-build to your path
Follow this guide
http://my.safaribooksonline.com/book/programming/android/9781849691529/setting-up-your-environment/ch01lvl1sec18
this is a frequent issue with openCV for Android. It stems from having the incorrect build target, which creates an error within the library for the Video.java file. After getting that patched up, you can import sample projects. Although, after fixing that, you may not be able to see the C/C++ Build node under project preferences. There's a fix for that on the second link. However, if under project preferences you can see C/C++ Build, make sure the path reads: "${NDKROOT}/ndk-build" Finally, it will be looking for NDKROOT,which is undeclared. The third link will direct you on how to do this, it's very simple. ALSO, make sure if your on MAC or LINUX to remove the .cmd from the end of NDK-BUILD. Good Luck!
Video.java issue:
http://answers.opencv.org/question/8266/opencv-library-244-on-eclipse-gives-error/
C++ Build/General Missing from Project Preferences:
http://stackoverflow.com/questions/16953548/eclipse-missing-c-c-build-and-general-from-project-properties
Now, make sure you add NDK root to the build varialbles so you can find it:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_add_build_var.htm`

Adobe air 3.0 ANE for Android, null ExtensionContext?

I've been working with the vibration example from Adobe for Air 3.0's native extensions on Android.
I have the ANE compiled and the .apk packaged.
The problem I'm having is the actionscript library is getting a null ExtensionContext.
I tried creating the .apk with adt -package -target apk-debug so that I can see the actionscript traces in logcat and that's where I'm finding the null error.
extContext = ExtensionContext.createExtensionContext("com.adobe.Vibration", null);
extContext is null and crashes on the following .call() method.
All of the source is stock from the examples, I haven't changed anything.
Does anyone have any experience with getting one of Adobe's ANE examples working on a windows machine? Most of the examples are for Mac.
Good lord. What a waste of a week.
I was using a tutorial from gotoandlearn.com that was telling me to, in by build script, use a jar command to put my native extension in to a jar.
I simply used the .jar that's automatically built in the NativeAndroid/bin/ folder and all is well.
It turns out, that tutorial is out dated and not really useful for the build anymore.
One additional comment. You need to set target platform and checkbox Is Library from Properties -> Android to get compiled jar in bin folder.
P.S. .sh from gotoandlearn can be executed in Powershell in Windows with minor changes for running bat files: ( cmd "/c adt.bat" )
I'm having the exact same problem on a Native Extension I'm writing, and have open sourced. I started this project with tutorial code from Adobe DevNet. I've found examples of this specific issue I've tried to follow exactly, and have had no luck with it yet. I've identified it to be a sandbox allow-domain problem.
Here's my line of code:
_aneContext = ExtensionContext.createExtensionContext("com.adobe.sampleasextension", "");
Here is a link to the code in my GitHub project:
https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as
Here is my compiler error:
SecurityError: Error #3207: Application-sandbox content cannot access this feature.
at flash.system::Security$/allowDomain()
at com.adobe.sampleasextension::SampleASExtension()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/ANESampleSWC/src/com/adobe/sampleasextension/SampleASExtension.as:14]
at ANESampleTest/initializeANE()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:198]
at ANESampleTest/onAddedToStage()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:131]
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at AppEntryCommon/run()
at global/runtime::AndroidMobileDeviceAppEntry()

Proguard ParseException with Default proguard.cfg on Android

I am about to release an application but, while i was building it using Export Tool of Android SDK in Eclipse, i get the error below.
I didn't change the proguard.cfg.
It is in the root folder of my project.
I only add proguard.config=proguard.cfg to default.properties.
I read the forum and update proguard (just copied the files to the tools folder of Android SDK), but still I doesn't work. I couldn't figure out what the problem is with the 'Projects\Eclipse' ??
If you help me, I will be so glad...
[2011-08-08 02:32:46 - CoolProject] Proguard returned with error code 1. See console
[2011-08-08 02:32:46 - CoolProject] proguard.ParseException: Unknown option 'Projects\Eclipse' in argument number 9
[2011-08-08 02:32:46 - CoolProject] at proguard.ConfigurationParser.parse(ConfigurationParser.java:172)
[2011-08-08 02:32:46 - CoolProject] at proguard.ProGuard.main(ProGuard.java:484)
Yeah that is right, but also I did something that I didn't know :)
My solution was:
I updated to latest Android SDK.
I changed SDK path property under Eclipse: Window > Preferences > Android > SDK Location as something like c:\Progra~1\android-sdk. The Progra~1 can be used for writing Program Files witout spaces. You can use DIR /X command in command prompt on Windows to get no space versions of Paths.
I moved my Eclipse Workspace to a location without spaces like D:\
The changes above didn't enough to solve the problem. I got "Conversion to Dalvik format failed with error 1" error dialog witout any explanation on output console. Then I found that topic and did what that reply says.
Then it worked ;)
I am using Windows 7 Ultimate x86. I hope it works for others too.
Arda.
Your project path probably contains a space. This should be fixed in the latest version of the Android SDK (at least for the Ant build). Otherwise, you should use a path without spaces for the time being.

Categories

Resources