NDK + Eclipse on Mac OS X: ERROR: Unknown host operating system: - android

Since I updated my NDK version to r10e (and deleted r9b which I've used consistently before), I get the following in Eclipse:
/Applications/android-ndk-r10e/ndk-build all
ERROR: Unknown host operating system:
/Applications/android-ndk-r10e/ndk-build: line 40: dirname: command not found
/Applications/android-ndk-r10e/ndk-build: line 132: uname: command not found
I'm definitely using the correct Mac OS X version of the NDK, and ndk-build works fine from the terminal.
The new NDK path is defined in Eclipse preferences of course.
What's going on here?

Related

Zipalign not working Catalina Mac OS , Bad CPU type in executable

After the install of Catalina Mac Os I starting to see this error when I run zipalign
/usr/local/bin/zipalign: line 3: /usr/local/Cellar/android-sdk/24.4.1_1/build-tools/23.0.1/zipalign: Bad CPU type in executable
/usr/local/bin/zipalign: line 3: /usr/local/Cellar/android-sdk/24.4.1_1/build-tools/23.0.1/zipalign: Undefined error: 0
looking for solutions I found that may be related to the fact that catalina only runs 64bit apps and zipalign is 32, couldn't find a 64 bit version. any ideas ?
I found the issue, catalina changes the shell by default or something related to it, I had a bash script /usr/local/bin/zipalign, that fixed the run of zipalign to /bin/bash producing the error , so removed the /usr/local/bin/zipalign file and added an export to the folder that contains the file directly.

Android Emulator not running for Cordova App - adb -s emulator-5584 shell cat /proc/cpuinfo

I'm trying to make my environment work with Cordova and Android emulator with no success. I have installed the Android Studio and I can successfully start the Android Emulator.
I have created a cordova application with the command below:
cordova create myApp
I added support for the Android platform:
cordova plataform add android
I had the following output:
Using cordova-fetch for cordova-android#~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
--save flag or autosave detected
Saving android#~6.2.3 into config.xml file ...
Then I try to run the application:
cordova run android
The emulator starts, after a while, that I have the error below in the command prompt:
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to Nexus_5X_API_24
Waiting for emulator to start...
Error: Failed to execute shell command "getprop,dev.bootcomplete"" on device:
Error: C:\Users\username\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 3221226356
Does anyone knows how to fix this error?
Some others environment info:
C:\>node -v
v7.4.0
C:\>cordova -v
7.0.1
C:\>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Edit 1
I have done those steps:
Uninstalled "Android SDK Tools"
Uninstalled "Android Studio"
Deleted files from "C:\Users\USER\AppData\Local\Android\sdk" and "C:\Program Files\Android\Android Studio" files (Because some maybe in use during the uninstallation)
Installed Android Studio
Updated Android Studio
When I execute the command below, I have more information about the error:
cordova run android --verbose
With this output:
Command finished with error code 3221226356:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe
-s,emulator-5584,shell,cat,/proc/cpuinfo Error: Failed to execute shell command "cat,/proc/cpuinfo"" on device: Error:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe:Command
failed with exit code 3221226356
When I execute the command below, the adb shows the emulator cpu info, after that, the process stops and the windows ask to break or debug
adb -s emulator-5584 shell cat /proc/cpuinfo
Downgrade your SDK platform-tools to rev25.0.1.
If you dev in windows, you can download it in https://dl-ssl.google.com/android/repository/platform-tools_r25.0.1-windows.zip
delete or rename your old platform-tools folder, and extract the downloaded file to it.
Works for me!
I encountered the same issue with an emulator of Nexus5 & Oreo/Nougat.
I changed my emulator to Galaxy Nexus & Lollipop and it worked fine without any modification in the Cordova directories.
It does not seem to be the right solution, but some lower combinations might be available for avoiding this issue.
The command line is:
$ cordova emulate android
The following is the success log:
No emulator specified, defaulting to Galaxy_Nexus_API_22
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
emulator: WARNING: encryption is off
path /home/ximia/.android/avd/Galaxy_Nexus_API_22.avd/system.img.qcow2
Waiting for emulator to boot (this may take a while)...BOOT COMPLETE
Edit your virtual device (ADV) and go into advanced settings and uncheck Multi-Core CPU.
Work fine to me.

How do you define the NDK installation that ndk-build uses?

How do you define the NDK installation that ndk-build uses? I used the r10e build for a good while, then updated my NDK and modified my $PATH to point to the new location, but when I build using the ndk-build command in Terminal it still uses the older android-ndk-r10e version.
I know this because I use the NDK_LOG=1 option when invoking ndk-build and it produces the following verbose information as it builds my project. Notice the references to "/NDKDev/android-ndk-r10e". That's my old installation.
~/Documents/MyNDKProject-- $ ndk-build NDK_LOG=1
HOST_OS=darwin
HOST_ARCH=x86_64
HOST_TAG=darwin-x86_64
GNUMAKE=/Users/user1/Documents/NDKDev/android-ndk-r10e/prebuilt/darwin-x86_64/bin/make (NDK prebuilt)
Android NDK: NDK installation path auto-detected: '/Users/user1/Documents/NDKDev/android-ndk-r10e'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: darwin
Android NDK: Host operating system detected: darwin
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to darwin-x86
Android NDK: Host tools prebuilt directory: /Users/user1/Documents/NDKDev/android-ndk-r10e/prebuilt/darwin-x86_64/bin
Android NDK: Host 'echo' tool: echo
. . .
Also note that when I enter echo $PATH at the Terminal prompt it gives:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin/:/sbin:/usr/local/bin:/Applications/android-sdk-macosx/ndk-bundle:/Applications/android-sdk-macosx
and where you see /Applications/android-sdk-macosx/ndk-bundle is exactly where it used to refer to the android-ndk-r10e path, so I'm certain I've updated my PATH successfully. So anyhow, IF the PATH environment variable is not what ndk-build uses to determine the NDK installation to use, what does it use, and how can I modify it so that it uses my new installation which is at:
/Applications/android-sdk-macosx/ndk-bundle
Fixed. The problem was that when the .bash_profile file is successfully sourced in a given Terminal session it does not have any effect on other instances of Terminal that are open. I had two instances of Terminal open and because I hadn't closed the one with which I was calling ndk-build the changes to .bash_profile weren't being applied.

ruboto Setup with Windows 8, apache ant not found

Hi I am trying to setup Ruboto on my Windows 8 and getting the following error even if say yes to download and install Apache via command prompt. Any help is appreciated
C:\>ruboto setup
Java runtime : Found
Java Compiler : Found
Apache ANT : Not found
Android Package Installer: Not found
Android Emulator : Not found
Intel HAXM : Not found
Android SDK Command adb : Not found
Android SDK Command dx : Not found
Platform SDK android-15 : Not found
!!! Ruboto setup is NOT OK !!!
Apache ANT was not found.
Would you like to download and install it? (Y/n): y
Downloading...
Installing apache-ant-1.9.0-bin.tar.gz...
F, [2014-10-05T09:58:23.048000 #15164] FATAL -- : not in gzip format (Zlib::Gzip
File::Error)
org/jruby/ext/zlib/JZlibRubyGzipReader.java:156:in `initialize'
org/jruby/ext/zlib/JZlibRubyGzipReader.java:85:in `new'
org/jruby/ext/zlib/JZlibRubyGzipReader.java:105:in `open'
download ant your self, and unzip to folder "c:\ant" , and udpate PATH with set PATH=c:\ant\bin;%PATH%" , now rerun ruboto setup
you may want to update your system path in windows, so the next time you open a cmd prompt you dont have to add ant path.

Android Studio Error on Mac

Just installed Android Studio 0.2.2 on my mac with osx 10.8.4 and opend new project tried to compile it and got this:`Gradle: Execution failed for task ':MyApplication:dexDebug'.
Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/18.0.0/dx --dex --output /Users/shimon_wi/AndroidStudioProjects/MyApplicationProject/MyApplication/build/libs/MyApplication-debug.dex /Users/shimon_wi/AndroidStudioProjects/MyApplicationProject/MyApplication/build/classes/debug /Users/shimon_wi/AndroidStudioProjects/MyApplicationProject/MyApplication/build/dependency-cache/debug /Applications/Android Studio.app/sdk/extras/android/m2repository/com/android/support/support-v4/13.0.0/support-v4-13.0.0.jar
Error Code:
1
Output:
/Applications/Android Studio.app/sdk/build-tools/18.0.0/dx: line 31: dirname: No such file or directory
/Applications/Android Studio.app/sdk/build-tools/18.0.0/dx: line 34: basename: No such file or directory
/Applications/Android Studio.app/sdk/build-tools/18.0.0/dx: line 48: dirname: No such file or directory
/Applications/Android Studio.app/sdk/build-tools/18.0.0/dx: line 52: basename: No such file or directory`
does any one know how to overcome this?
I hit same issue today with android studio 0.4.2 and sdk version 20131030.
Seems like "dx" script does not have correctly set PATH (or maybe this applies only when invoked from Android Studio, who knows..). I was able to get it working by adding
export PATH=$PATH:/usr/bin/:/bin/
to
sdk/build-tools/android-4.4/dx
(first line after comments block). Not saying this is ideal solution, but it does not seem to be configurable in Android Studio and it does not introduce any risk to proper function of SDK. And might have to do this again when SDK is updated/reinstalled.
I can't tell you what causes this problem, but I managed to solve it for me. Hopefully you have the same issue as me: What happened was that I enabled the system firewall for OS X. By mistake I banned java. After this the problem appeared. Restarting the terminal and re-enabling java fixed the problem (System preferences --> Security & Privacy --> Firewall --> Firewall options).
In my case the problem was the $ PATH in OS X 10.9.4.
'dirname' and 'basename' commands are in the /usr/bin usually and '/usr/bin' is included in your $PATH.
But I modify the /etc/launchd.conf file incorrectly.
So /usr/bin is not included in $PATH.
Perhaps this problem will occur only in the IDE and to be fine in the terminal.
Please check your $PATH value.

Categories

Resources