Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26151] Ti.Platform.id not working on Android in 7.2.0.GA (works on 7.1.1.GA)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-06-30T10:01:46.000+0000
Affected Version/sRelease 7.2.0
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsandroid, regression
ReporterRaef Akehurst
AssigneeYordan Banev
Created2018-06-23T13:44:08.000+0000
Updated2018-11-03T10:38:42.000+0000

Description

I just tried upgrading to Ti 7.2.0.GA and found that Ti.Platform.id is returning null on Android. It works when reverting back to 7.1.1.GA. And it works on iOS. When using 7.1.1.GA alert(Ti.Platform.id); returns a string (as expected). When using 7.2.0.GA alert(Ti.Platform.id); returns "null". Given 7.2.0 looks like it was mostly about GDPR, could it have been pulled out inadvertently? Or does the documentation need updating (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform-property-id)? Or am I missing something?

Comments

  1. Sharif AbuDarda 2018-06-24

    Hello, I am able to reproduce the issue for Android with SDK 7.2.0.GA. This is a valid issue. Thanks.
  2. Michael Gangolf 2018-06-24

    Works fine on my phone:
       var win = Ti.UI.createWindow({});
       
       win.addEventListener("open",function(){
       	alert(Ti.Platform.id);
       })
       win.open();
       
    *Output*: String (my id) Ti SDK 7.2.0.GA Phone: HTC A9 (7.0)
  3. Raef Akehurst 2018-06-25

    Hmmm. If I create a fresh project it works for me too. If I put it in my existing project it does not. Obviously, something is not playing nice. I quickly tried with a fresh Alloy project. Worked. I also tried a fresh project with the same uses-sdk, uses-feature, and uses-permission as in my main project that is not working. Worked. Might be a module causing it??? I will report back later when I have time to go through and rule things out by the process of elimination.
  4. Yordan Banev 2018-06-25

    [~raefa] You can check if enabling/disabling analytics for the project in tiapp.xml has an effect on that behavior. This node:
       <analytics>true</analytics>
       
    Update: I was able to reproduce the described issue with 7.2.0.GA
  5. Raef Akehurst 2018-06-25

    @Yordan Banev That was it. I too was able to replicate it if I turned analytics off.
  6. Yordan Banev 2018-06-28

    PR: https://github.com/appcelerator/titanium_mobile/pull/10008 7_3_X: https://github.com/appcelerator/titanium_mobile/pull/10141
  7. Samir Mohammed 2018-07-02

    *Closing ticket.* Fix verified in SDK Version 7.3.0.v20180628132121 and SDK Version: 7.4.0.v20180702110619. *FR Passed (Test steps)*

    Created an application with the following code

       var win = Ti.UI.createWindow(),
       	button = Ti.UI.createButton({title: 'Get Info'});
       button.addEventListener('click', function () {
       	alert('Address: ' + Ti.Platform.address + '\n' +
       		'Architecture: ' + Ti.Platform.architecutre + '\n' +
       		'Available Memory: ' + Ti.Platform.availableMemory + '\n' +
       		'Battery Level: ' + Ti.Platform.batteryLevel + '\n' +
       		'Battery Monitoring: ' + Ti.Platform.batteryMonitoring + '\n' +
       		'Battery State: ' + Ti.Platform.batteryState + '\n' +
       		'Id: ' + Ti.Platform.id + '\n' +
       		'Id for Advertising: ' + Ti.Platform.identifierForAdvertising + '\n' +
       		'Id for Vendor: ' + Ti.Platform.identifierForVendor + '\n' +
       		'Is AdTracking enabled: ' + Ti.Platform.isAdvertisingTrackingEnabled + '\n' +
       		'Locale: ' + Ti.Platform.locale + '\n' +
       		'Mac address: ' + Ti.Platform.macaddress + '\n' +
       		'Manufacturer: ' + Ti.Platform.manufacturer + '\n' +
       		'Model: ' + Ti.Platform.model + '\n' +
       		'Name: ' + Ti.Platform.name + '\n' +
       		'Netmask: ' + Ti.Platform.netmask + '\n' +
       		'OS name: ' + Ti.Platform.osname + '\n' +
       		'OS type: ' + Ti.Platform.ostype + '\n' +
       		'Processor count: ' + Ti.Platform.processorCount + '\n' +
       		'Runtime: ' + Ti.Platform.runtime + '\n' +
       		'Username: ' + Ti.Platform.username + '\n' +
       		'Version: ' + Ti.Platform.version);
       });
       win.add(button);
       win.open();
       

    Set Analytics in the Tiapp.xml to false

    <analytics>false</analytics>

    Ran the application

    Pressed get info

    Application no longer crashed and information was shown

    *Test Environment*
       APPC Studio: 5.0.0.201712081732
       APPC CLI: 7.0.4
       Pixel XL (8.1.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13
       Node.js Version: 8.9.1
       Xcode 9.2
       
  8. Joe Falcone 2018-11-03

    This regression has resurfaced in the 7.5.0 RC 7.5.0.v20181102122228 with the same behavior related to set to false.

JSON Source