android build fails - No such file or directory - ./apkbuilder - android

I'm trying to build a package using
rake run:android
and I get the error
No such file or directory - ./apkbuilder
My project setup is given below:
rhodes-3.5.1.12
ndk version: ndk-r8b 32 bit
sdk version: android 4.2.2 API 17
I'd tried with 4.3 API 18 but it's not working.
To reach upto this point I'd copied the file aapt in to platform-tools also created a lib directory in platform-tools and put the dx.lib in it.
I'd tried with different combinations. Rhodes 3.4.2, ndk-r9 64 bit and 32 bit. Only ndk-r8 32 bit is working for me. Could anyone tell me what is the problem here?
Or a working combination of sdk, ndk and rhodes?
I've fixed the issue. Added a new answer below.

The problem of the missing apkbuilder.bat is not coming from the Android NDK but from the Android SDK. Google, in build tools r22 moved some files in different directory, breaking rhodes and a lot of other Android tools.
You've different options:
Use RhoMobile Suite v4.0
Stick to RhoMobile Suite v.2.2 downloading the latest v3.5 rhodes gem from github (using the 3-5-stable branch).
Use Android SDK build tools r21
more information are available on Launchpad, the RhoMobile community site by Motorola Solutions.

I've fixed it like this in mac os:
Use the latest versions of SDK, NDK and rhodes 4.0.0
Get rhodes like following:
git clone git://github.com/rhomobile/rhodes.git
cd rhodes
git checkout 4.0.0
gem build rhodes.gemspec
sudo gem install rhodes-4.0.0.gem
Try to build again. If still not working send me a message, I'll try my best :)

apkbuilder is deprecated.
THIS TOOL IS DEPRECATED and may stop working at any time!
current just the batch or bash script be removed
you can just create a new apkbuilder file in android-sdk-linux/tools dir
by:
window:
copy android.bat apkbuilder.bat
modify apkbuilder.bat: change com.android.sdkmanager.Main to com.android.sdklib.build.ApkBuilderMain
linux or mac:
cat android | sed -e 's/com.android.sdkmanager.Main/com.android.sdklib.build.ApkBuilderMain/g' > apkbuilder
chmod a+x apkbuilder

It seems that :
rhodes 3.5 does not support 64 bits ndk
some tools are in a different path in ndk9 and rhodes 3.5 can't find them.
So you have to stick with 32 bits and ndk8 with rhodes 3.5.
Rhodes 4 should work with 64 bits and ndk9.

Related

Today's working combination of tool versions for C++ Android programming with Qt?

What is a working combination of versions of the development tools if I want to develop C++ Qt Android apps? I tried several combinations but they all fail with strange build errors of a simple Hello World test app.
Currently, I have
Qt Creator 4.2.1 (based on Qt 5.8.0, MSVC 2015, 32bit)
JDK 10.0.1
Android SDK 24.4.1-win
Android NDK r10e
Apache ant 1.9.11
but e.g. that fails with
Buildfile: build.xml does not exist!
Build failed
Warning: Android platform 'android--1' does not exist in SDK.
Building the android package failed!
-- For more information, run this command with --verbose.
21:35:44: Der Prozess "C:\EigeneDateien\bin\Qt-5.8.0\5.8\android_armv7\bin\androiddeployqt.exe" wurde mit dem Rückgabewert 14 beendet.
I want to use an open source version.
Please, give a list of tools with correct version numbers and maybe download links.
The good procedure is to use Qt's online installer (https://www.qt.io/download-qt-installer), get the latest version of QtCreator/Qt, then the latest version of ndk/sdk/jdk and cross your fingers because it does not always work...
I fighted a bt with this in early 2019 and here is a combination that perfectly works for me since then, under Windows 7 and 10.
QtCreator 4.8.0, based on Qt 5.12.0. I got it from the online installer by then and archived it, but you can apparently specifically download it from here.
NDK r18b
JDK 1.8.0_201, can be dowaloaded from this page (find jdk-8u201-windows-x64.exe)
Android SDK command line tools "sdk-tools-windows-4333796", available here. Then used sdkmanager to download API platform-tools and android-28. Try sdkmanager "platform-tools" "platforms;android-28"
No need for ant anymore, QtCreator will download and use gradle silently.

Android studio 2.1.2 gradle aapt Syntax error: Unterminated quoted string

I am trying to run Android Studio 2.1.2 on 32bit linux Mint 17.3.
Android studio is freshly installed.
When I rebuild a project or create a new one, I get errors like this in the Gradle Console:
AAPT err(Facade for 19314581): /home/user/Android/Sdk/build-tools/24.0.1/aapt: 2: /home/user/Android/Sdk/build-tools/24.0.1/aapt: Syntax error: Unterminated quoted string
Aapt is set as executable in build-tools directory.
I have set:
export SLAVE_AAPT_TIMEOUT=30
export ANDROID_EMULATOR_FORCE_32BIT=true
Any other idea how to fix this?
I had the same problem. I fixed it by downgrading my build tools version from 24.0.1 to 23.0.3.
Download older build tool version from http://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip
Extract the downloaded file and paste it in your SDK build-tools directory( mostly /home/user/Android/Sdk/build-tools)
Now in your app:gradle file change the buildToolsVersion to "23.0.3"
Sync your gradle file and you should be good to go
Hope google fixes its build-tools bug
It might be the case the newest Android Studio does not run on 32bit only system.
On AndroidStudio download page the requirements for Linux are:
64-bit distribution capable of running 32-bit applications
There are also other StackOverflow questions regarding this:
Android Studio 64-bit ERROR: 32-bit Linux Android emulator binaries are DEPRECATED
ERROR: 32-bit Linux Android emulator binaries are DEPRECATED
The former one states:
Either one will allow you to use the 32-bit binaries,but please be aware that these will disappear in a future Android SDK
release. Consider moving to a 64-bit Linux system before that happens.
So it might be the case the newest version does not support 32bit anymore.
Please try suggestions mentioned in the related answers (updating kernel/system). For Linux Mint there is mentioned [1]:
Go to terminal
type gedit .profile
paste the below line at end of the page
export ANDROID_EMULATOR_FORCE_32BIT=true
type source .profile in terminal or restart system
But it also might be the case the newest Android Studio version does not support 32bit-only system anymore. In that case try to use an older version.

android studio adb Syntax error: ")" unexpected

this morning when I start doing my daily routine(opening android studio 1.5.1 in my PC - lubuntu 32 bit) I encounter an error after I try to run my application to my device. This is the android studio error:
Error running app: Unable to obtain debug bridge
Unable to detect adb version, adb output: /root/Android/Sdk/platform-tools/adb: 1: /root/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected
I was looking for possible solution for hours now through internet but can't find same error as this. I already try some other remedies but still no luck of solving it. Can you help me guy? Thanks in advance.
for 32bit users... Don't update "platform-tools" to version 23.1.
foremost version you can use is 23.0.1 which you can download here
If you are on 64bit machine and having trouble using the latest version of the plateform-tools.. check instructions here.
thanks for the working link- #Tyler
OK. after some research found that reason for this is because
android-sdk-linux/platform-tools content is 32-bit
ELF in 23.0.1 but 64-bit ELF in 23.1_rc1 and 23.1.0. So, several
functions in android-studio (and I assume eclipse+ADT as well) fail
because of the attempt to run 64-bit executables.
This issue has already been raised HERE
Also, as per the official comment given by google project member parts of the platform-tools will support 64 bit Ubuntu OS only from 23.1.0 onwards.
Platform-tools 23.1.0 OR onwards will not work on Ubuntu 32-bit OS. Developer needs to upgrade Ubuntu OS to 64-bit to make it work.
That eventually means we only have possible two workarounds now :
1. Stick with Platform-tool 23.0.1 as of now. and DO NOT UPGRADE platform-tools to 23.1.0 or above
2. Change your Ubuntu OS to 64-bit instead of 32-bit.
I hope this would help someone.
download sdk platform-tool 23.0.1 from this link
As Arnav M. said, for Ubuntu 32bit users, stick to 23.0.1 or install a 64bit Ubuntu. For more details see this:
https://stackoverflow.com/a/34239600/3032209
What you actually need to do is downgrade your platform-tool, which contains Android Debug Bridge, to lower version.
Download the platform-tool package from following link
platform-tools_r23.0.1-linux
Unzip the package and replace the platform-tool folder, in android-sdk folder, with the downloaded platform-tool folder.
After restarting android studio, it may ask you to upgrade platform-tool. Ignore it.

Compiling android tools for windows

I have set up a 64 bit ubuntu env for compiling android tools (aapt, adb etc...), i'm now downloading the source code for 2.1.
I have compiled the env in the past with no problem, built emulator and stock version.
But it was all linux binaries (the sdk tools)
The more i think about it the less i understand,How i can build those tools for windows machine ? (ubuntu runs on virtual box on top of my hosting Server 2008 which is my work env).
I saw some posts related to minGW but as far as i know these are windows libraries that are meant to compile linux binaries on windows machine. I am looking for a way to compile windows binaries on linux machine.
I must say it seems impossible since i'm not sure how the linker in linux will generate an exe file, ithought of taking the .o file and try to link them under windows (VS) but i'm not sure it will work, I'll have to find compatible dlls to the API's on linux.
How do goolge create a windows SDK?
well with the help of several posts and of 'inazaruk' i managed to find the command : $ make -j PRODUCT-sdk-win_sdk showcommands dist
it compiled and in ./out/host/ i had the windows binaries. pretty cool :-) i didn't need to take them out and recompile under windows.
Hopes this helps anyone else that needs to recompile the SDK tools.
make -j8 win_sdk
also builds windows sdk.

buiding android sdk

how to build sdk from source code
Have a look there.
To build the Android source files, you will need to use Linux or Mac OS. Building under Windows is not currently supported.
The command for building the sdk is make sdk.
The steps to build the SDK are described in http://tools.android.com/build including the steps to build the Windows SDK (which is done under Linux.)

Categories

Resources