Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25852] Android: Target API Level 26/27 by default

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-05-11T20:32:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsandroid, android-8, demo_app
ReporterJoshua Quick
AssigneeGary Mathews
Created2018-03-09T19:13:21.000+0000
Updated2018-06-25T23:43:54.000+0000

Description

*Summary:* When building for Android, Titanium currently only supports targeting API Levels 23-25 (aka: Android 6.0 - 7.1) if not specified in the "tiapp.xml" file. We should increase the max API Level supported to 27 (aka: Android 8.1) once full functional/regression testing has been performed and any issues discovered have been addressed. *Changes Required:* This involves changing the "package.json" file's "android sdk" range... from: ">=23.x <25.x" to: ">=23.x <27.x". https://github.com/appcelerator/titanium_mobile/blob/master/android/package.json#L24 We should also consider updating the "android build tools" version range as well. *Note:* Titanium developers currently can opt-in to targeting API Level 26+ (aka: Android 8.x) in the "tiapp.xml" themselves as shown below.
<ti:app>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
    		<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26"/>
        </manifest>
    </android>
</ti:app>

Comments

  1. Rene Pot 2018-03-12

    In this ticket I've also included an update for the default tiapp.xml by adding the target sdk in the manifest. This is someting most people want/need and adding it to the template might be beneficial by builds not breaking when people install a newer SDK. It also tells people it is possible to select a minimum version and that targeting builds is implemented as functionality.
  2. Michael Gangolf 2018-03-12

    If you add the manifest part then please add <manifest android:versionCode="1" android:versionName="1.0.0">, too! Since you need this for store updates it would be good to have this in the template already
  3. Rene Pot 2018-03-12

    [~michael] would you in that case also prefer the iOS version of that included?
  4. Michael Gangolf 2018-03-12

    iOS works fine by just updating the part. But on Android you HAVE to update the versionCode to in order to make an update. This is always a problem for new users because they just increase the part and see the versionCode error in the Google Console. So they have to search the part and add the in order to make the update
  5. Hans Knöchel 2018-03-12

    This is unrelated to this ticket and should be done in an own one. Ideally by also handing the version tag correctly and auto-bump the versionCode if not manually overriden
  6. Joshua Quick 2018-03-12

    [~topener], I don't think we should add a <uses-sdk/> to the "tiapp.xml" template. Titanium's build system will automatically add this to the "AndroidManifest.xml" set to the min API Level supported and the highest target API Level supported and installed on the machine. This way it's future proof and won't cause a build failure if we increment the min API Level supported in Titanium. This means less tech-support issues. Developers who add a <uses-sdk/> are opting-in to managing it themselves and I'm okay with them getting a build failure in the future.
  7. Rene Pot 2018-03-13

    [~jquick] yeah good point! I've reverted that part of the commit ;)
  8. Joshua Quick 2018-03-13

    [~topener], for your info, we haven't fully tested targeting API Level 26 yet. We still need to identify breaking changes before merging this PR. Our QE team is a bit behind at the moment and hasn't had time yet, but the quick test for the moment is to run though our Kitchen Sink app to see what breaks. For example, I'm pretty sure local notifications will fail to be posted to the status bar when targeting API Level 26 and running on Android 8. This is because our core code does not assign the notification a channel. But when targeting a lower API Level, our app is put into backward compatibility mode and Android 8 will auto-assign it a default channel number. We haven't confirmed this yet, but I'm pretty sure this is true. _(Our "ti.cloudpush" module does not have this issue and already resolves this breaking change.)_ There may be other issues too such as this... https://stackoverflow.com/questions/46980697/lock-screen-orientation-when-targeting-android-api-27-with-a-non-opaque-activity We've got a lot of testing to do, that's for sure. :) The current release version of Titanium allows you to target API Level 26/7 now. So, if you have any interesting apps to test with, please give it a go. Thanks.
  9. Joshua Quick 2018-03-13

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9930 ^ This PR needs to build against the newest API Level to support the newest Google Support libraries. So, we might as well as do this all in one shot in a single PR.
  10. Rene Pot 2018-03-13

    yep makes sense! :)
  11. Lokesh Choudhary 2018-05-11

    FR Passed. PR Merged.
  12. Lokesh Choudhary 2018-06-25

    Verified the fix in SDK 7.3.0.v20180625114905. Closing.

JSON Source