Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26141] Android: Accessing Titanium.App.Android.R logs GC errors

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-10-29T22:22:06.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsalloy, android
ReporterDavid van de Meer
AssigneeGary Mathews
Created2018-06-06T03:54:59.000+0000
Updated2018-10-29T22:22:09.000+0000

Description

When building an Alloy app with Ti SDK 7.1.1 accessing Titanium.App.Android.R causes the logs to trow errors:
[ERROR] JavaObject: !!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: 0
[ERROR] JavaObject: !!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: 0
How to reproduce: 1. Create new Alloy app 2. Add the following code below in alloy.js: 3. Build 4. See errors in logs.
Ti.API.info("Hyper Hello");
Ti.API.info(Titanium.App.Android.R);
Logs:
[INFO]  Hyper Hello
[ERROR] JavaObject: !!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: 0
[ERROR] JavaObject: !!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: 0
[INFO]  [object R]

Comments

  1. Sharif AbuDarda 2018-06-08

    Hello, we can reproduce the issue, At the moment, we don't know why it's happening but seems harmless at the moment. It doesn't break the app or cause a crash. Thanks.
  2. David van de Meer 2018-06-18

    Why would you mark this as resolved? Yes its not causing issues but its not "Resolved"
  3. Hans Knöchel 2018-06-20

    This is indeed a valid issue and should be looked into. It may be an issue with our V8 binding (cc [~cwilliams], [~gmathews]) and also happens for random Hyperloop examples (using the hyperloop-examples app) on SDK 7+ only.
  4. Gary Mathews 2018-06-22

    master: https://github.com/appcelerator/titanium_mobile/pull/10129
  5. Samir Mohammed 2018-07-20

    *Closing ticket*, Verified fix in SDK Version: 7.4.0.v20180718223310 *FR Passed (Test Steps):*

    Created a titanium application with the following code

       Ti.API.info("Hyper Hello");
       console.log(Ti.App.Android.R);
       

    Ran the program

    Application no longer showed a GC error

    *Test Environment*
       APPC Studio: 5.0.0.201712081732
       APPC CLI: 7.0.4
       Nexus 6p Emulator (8.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13
       Node.js Version: 8.9.1
       Xcode 9.2
       

JSON Source