android sdk build tools 25 on centos 6.8 error - android

I'm using jenkins for CI and after updating my build tools version to 25 I got this error:
"processReleaseResources/opt/android-sdk-linux/build-tools/25.0.0/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/android-sdk-linux/build-tools/25.0.0/aapt)"
I need to use buildtools 25 and my server centos version is 6.8.
How can I update glibc ?

Apparently, the program you are trying to use was not compiled for Red Hat Enterprise Linux 6 (which only provides glibc 2.12, and not version 2.14 or later, which seems to be needed here). You either have to recompile it on that version of the operating system, or upgrade to a later version of Red Hat Enterprise Linux.

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.

cordova requirements issue with Android target: "android-24

While installing requirements for cordova in ubuntu... i am facing the target android issue:
Android target: not installed
Please install [Android target: "android-24][1] #target".
Hint: Open the SDK manager by running:
/home/hemanth/android-studio/tools/android
You will require:
"SDK Platform" for android-24 #target
"Android SDK Platform-tools (latest)
"Android SDK Build-tools" (latest)
Gradle: installed
Requirements check results for browser:
Check failed for browser due to Failed to check requirements for
browser platform. check_reqs module is missing for platform. Skipping
it... Error: Some of requirements check failed
Even I have installed api 24 still I am getting same error
https://i.stack.imgur.com/Mwvns.png
how to correct this target android error?
i got it..its just installation issue...api-24 version supported by cordova but have to install all APIs ..before doing click on start new project in android-studio
android-studio home page ->settings -> sdk manager -> Select APIS to download
now no issue with target android error
[1]https://i.stack.imgur.com/w5Mrs.png "cordova requirements result"
Unless you have an old version of the SDK, the android cmd is deprecated. Instead try this 1st: avdmanager list target
I'm assuming it won't return anything so then run this: sdkmanager --list
The 1st thing it spits out is what you have installed followed by a list of available packages. Assuming you don't have any platforms installed, look in the list of available packages for platforms;android-XX where XX is the version you wish to target (it should match your platform-tools version)
Then run: sdkmanager "platforms;android-XX"
Now when you run avdmanager list target you should see the API version you just installed and your app should build.
As per their documentation only API Version 23 and below are supported (as of 2017-01-11. Down to version 10 or version 14 of the android API depending on your version of Cordova): http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html
Requirements and Support
Cordova for Android requires the Android SDK which can be installed on OS X, Linux or Windows. See the Android SDK's System Requirements. Cordova's latest Android package supports up to Android API-Level 28¹. The supported Android API-Levels for the past few cordova-android releases can be found in this table:
cordova-android Supported Android Equivalent Android
Version API-Levels Version
8.X.X 19 - 28 4.4 - 9.0.0
7.X.X 19 - 27 4.4 - 8.1
6.X.X 16 - 26 4.1 - 8.0.0
5.X.X 14 - 23 4.0 - 6.0.1
4.1.X 14 - 22 4.0 - 5.1
4.0.X 10 - 22 2.3.3 - 5.1
3.7.X 10 - 21 2.3.3 - 5.0.2
Please note that the versions listed here are for Cordova's Android package, cordova-android, and not for the Cordova CLI. To determine what version of Cordova's Android package is installed in your Cordova project, run the command cordova platform ls in the directory that holds your project.
As a general rule, Android versions become unsupported by Cordova as they dip below 5% on Google's distribution dashboard.
¹NOTE: This has been updated as of 2020-04-18 to update information in the table above. The wording of the post is being retained as answered so as to speak to the original question as asked. Future readers are advised that they should consult the source link to confirm version compatibility.

Installing version 16 of the Android SDK tools

I'm trying to build a project in Android Studio that targets API16 (Android version 4.1.2). Using the SDK manager I was able to download that SDK platform but an exception is raised at compile-time as it's trying to parse a compiled .jar file:
bad class file magic (cafebabe) or version (0034.0000)
My understanding of this issue is that I need the build tools to match the API version I'm targeting (since I currently only have the most recent version of the build tools). However, I am unable to install them because they're unavailable in both the SDK manager and on the Android website (http://developer.android.com/tools/revisions/build-tools.html). Is there another way to install this version of the build tools? (Alternatively, if installing that version of the build tools is unnecessary, how do I resolve this issue?)
This is a problem with the Java version (i.e. the version the jar, or rather the class files inside it, was compiled with). It actually has nothing to do with the Android version.
0x34 means the jar was compiled with Java 8 (see the list of possible values here). Android can only use jars compiled as Java 6.
If you have the sources for this library, you should recompile it again with the -target 1.6 flag.

JDK 7 and Android IDE

I have jdk 6 and 7 installed on my PC.
On this link https://developer.android.com/sdk/index.html#ExistingIDE , I read that Android IDE is compatible with jdk 6, but I want to know if Android SDK works also with jdk 7 or if there are problems ?
If there are problems can I mantain the jdk 7 and configure Android sdk to use Jdk 6 ?
You can build a project using JDK 7 in Eclipse with the ADT plugin with no extra configuration and with any version of the ADT plugin, so long as you only use features in JDK 6.
Support for Java 7 language features was added to the Eclipse ADT plugin in March 2014 (ADT 22.6.0 and up). All you need to do is update your application project settings to use JDK 7 and ensure that Eclipse is running on JDK 7 as well.
Note that unless your minSdkVersion is 19+ (KitKat), you cannot use try-with-resources.
From the ADT plugin tools page:
ADT 22.6.0 (March 2014)
General Notes:
Added support for Java 7 language features like multi-catch, try-with-resources, and the diamond operator. These features require
version 19 or higher of the Build Tools. Try-with-resources requires
minSdkVersion 19; the rest of the new language features require
minSdkVersion 8 or higher.
To use the new language features after
installing ADT 22.6.0, ensure that you run Eclipse on JDK 7 and change
your application project settings to use JDK 7.
Yes, you can use Java 1.7 for the android development.
Starting from build tools 19, Android has full support for Java 1.7. So you can set 1.7 as source and target for compilation. Support for this is from Android studio 0.3.2. Android kitkat has full support of JAVA 1.7 API, but most of language features from 1.7, can be used on the older android versions too.
Edit:
You can also mantain the jdk 7 and configure the Android application to use Jdk 6 during compilation.
It's not even necessary to have JDK 6 installed. You can just configure Eclipse to "compile as JDK 6" and it will work.
To change for the whole workspace, enter Window -> Preferences, then Java -> Compiler and set Compiler compliance level to 1.6.
You can also do this in individual projects, if you prefer, in Project -> Properties -> Java Compiler.
I noticed the same problem today http://developer.android.com/sdk/installing/installing-adt.html where the recommended jdk is 1.6 but according to the main bundle Android has full support for 1.7 http://developer.android.com/sdk/installing/index.html?pkg=studio.
So I woudl say...Yes! 8 )

Android-Jenkins: failed to find Build Tools revision 17.0.0 On Jenkins Build Server

I'm trying to use the Android Emulator on Jenkins to build and test my project. But I'm getting an the following error when running my gradle tasks;
failed to find Build Tools revision 17.0.0
the gradle task I'm running is;
./gradlew clean connectedCheck
in my gradle build file I has the following configuration
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 17
}
}
The build server is a headless Ubuntu instance (12 something). My first thought was that I didn't have the correct build tools installed so I had a look in my android-sdk/build-tools director. All I could see was a directory called 18.1.1. So I thought if I updated my android sdk it would download version 17.0.0. So I ran the following command:
android update sdk --no-ui
and it seems to download various many things but looking in the build tools directory again I still only see version 18.1.1.
So questions are:
1) Am I right in assuming the build is failing because I don't have the correct build tools revision in my android sdk directory? (/android-sdk/build-tools)
2) How do I update the build-tools on a headless server so that I have version 17.0.0?
If you need me to provide more information, please let me know.
Thanks in advance for you help.
By default, android update sdk (or android list sdk --extended) only lists the packages which aren't considered deprecated.
As Build Tools 17.0.0 is a comparatively old version, it won't be shown by default.
Running with the -a (--all) flag will get you the older versions, e.g.:
android update sdk -u -a -t build-tools-17.0.0
At some point in the future the Jenkins plugin should automatically install the correct build tools for you, based on your build.gradle file.
Edit (Nov 2015): This functionality probably will not be added to the Android Emulator plugin.
Nowadays I would recommend using the android-sdk-manager Gradle plugin, which automates the installation of all prerequisites for a Jenkins build, including Android SDK, tools, build-tools, platforms, support libraries etc.
This can be very easily integrated into your project, and removes the need to keep the Android SDK installation on your Jenkins build machines up-to-date.
Other way to do it, is manually update for the missing version using Android SDK Manager attached to Jenkins (Look for Configuration: ANDROID_SDK, then under it access "tools/android.sh")

Categories

Resources