Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25047] Output from building a native Android module indicates that incorrect API levels are being used

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-03-20T16:32:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterPeter Lancaster
AssigneeUnknown
Created2017-07-14T10:35:17.000+0000
Updated2018-03-20T16:32:35.000+0000

Description

When building / recompiling a native module, the output indicates that it may not be *fully* supporting later Android toolsets, or that internal config is searching for a _default_. From *ti config*, if you have set your Android build tools as this:
android.buildTools.selectedVersion = "25.0.3"
It does not seem to affect the version of the *android.jar* that is referenced, only the *aapt* version. As an example, output like this is seen from the command: *ti build -p android --build-only*
Running AAPT command: /path/to/AndroidSDKs/for/Titanium/build-tools/25.0.3/aapt package -f -I /path/to/AndroidSDKs/for/Titanium/platforms/android-23/android.jar -M /path/to/native/module/being/built/android/build/intermediates/manifests/aapt/AndroidManifest.xml -S /path/to/native/module/being/built/android/build/intermediates/res/merged -m -J /path/to/native/module/being/built/android/build/generated/r --custom-package com.nativemodule.namespace --non-constant-id -0 apk --output-text-symbols /path/to/native/module/being/built/android/build/intermediates/bundles --no-version-vectors --extra-packages android.support.v7.appcompat:android.support.v7.cardview:ti.modules.titanium.ui
And output like this, is seen from the alternative *appc run -p android --build-only* command:
[INFO]  Building Java source files: /Library/Java/JavaVirtualMachines/jdk_version.jdk/Contents/Home/bin/javac "-J-Xmx256M" "-encoding" "utf8" "-d" "/path/to/native/module/being/built/android/build/classes" "-classpath" "/path/to/AndroidSDKs/for/Titanium/platforms/android-23/android.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/lib/closure-compiler.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/lib/titanium-debug.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/lib/titanium-profiler.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/lib/titanium-verify.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-accelerometer.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-analytics.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-android.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-app.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-appcompat.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-calendar.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-cardview.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-contacts.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-database.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-filesystem.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-geolocation.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-gesture.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-locale.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-map.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-media.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-network.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-platform.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-ui.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-utils.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/modules/titanium-xml.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-animated-vector-drawable.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-annotations.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-multidex.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-v4-internal_impl.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-v4.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-v7-appcompat.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/android-support-vector-drawable.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/aps-analytics.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/cardview-v7-23.4.0.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/freemarker.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/jaxen-1.1.1.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/json_simple-1.1.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/kroll-apt.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/kroll-common.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/kroll-v8.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/nineoldandroids-appc-2.4.0.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/ti-commons-codec-1.3.jar:/path/to/Titanium/sdk/osx/6.1.1.GA/android/titanium.jar:/path/to/native/module/being/built/android/lib/included.jar" "-target" "1.6" "-g" "-source" "1.6" "@/path/to/native/module/being/built/android/java-sources.txt"

Comments

  1. Gary Mathews 2017-07-18

    [~plancaster] I'm not sure I understand the issue? The Android build-tools version is not the same as the Android SDK API version being targeted. If you want to specify a different Android SDK API target (e.g: 25) add this to your timodule.xml
       <android xmlns:android="http://schemas.android.com/apk/res/android">
       	<manifest>
       		<uses-sdk android:targetSdkVersion="25"/>
       	</manifest>
       </android>
       
  2. Peter Lancaster 2017-07-18

    Hi Gary, Thanks for your response - however, tests indicated that changing the manifest to target anything above 23 didn't make a difference to the android jars being referenced in the CLI output. Other questions asked have indicated that Titanium / Appc does not fully support Android API levels above 23 currently - so at this point, we'd just like to understand why android-23 appears in the build output, when several other API levels (above and below) are present in the same location. Does the build default to using android-23? Is there something hardcoded somewhere?
  3. Gary Mathews 2017-07-18

    [~plancaster] We target the highest Android API we support, which is currently 23. You _can_ specify a higher (or lower) target API using the snippet I provided above, but you could run into issues when targeting a higher unsupported API.
  4. Peter Lancaster 2017-07-19

    Probably worth noting, at the original point of logging this ticket - the docs indicated support for API level 25 (but this has now been amended). What we're interested in particularly here though - is whether there's a hardcoded reference to android-23 somewhere, or whether that specific version of the SDK is being used for something specific (as it contains the *android* keyword for example)?
  5. Ricardo Ramirez 2017-07-20

    [~gmathews] Can we update the docs ?
  6. Eric Merriman 2018-03-20

    Documentation update to reflect this. Closing.

JSON Source