Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13443] Android: Deprecate incrementServiceRefCount, decrementServiceRefCount and getServiceRefCount before removing them

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-08T22:47:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07, Release 3.2.0
ComponentsAndroid
Labelsqe-closed-3.1.0, regression
ReporterMartin Guillon
AssigneeAllen Yeung
Created2013-04-06T07:25:51.000+0000
Updated2013-04-09T23:35:34.000+0000

Description

this [commit](https://github.com/appcelerator/titanium_mobile/commit/48fd5c12f6f7b4941affd5ce8d6a0ab9f65113fc) broke backward compatibility of modules when using : incrementServiceRefCount decrementServiceRefCount getServiceRefCount Method names have changed without supporting deprecated. As a consequence a module built before will crash using a newer sdk and vice versa

Attachments

FileDateSize
com.service-android-0.1.zip2013-04-08T22:06:30.000+000044969

Comments

  1. Ingo Muschenetz 2013-04-07

    [~farfromrefuge] Those APIs are private and not listed as being supported from release to release. Is there a reason you are relying on them?
  2. Martin Guillon 2013-04-08

  3. Allen Yeung 2013-04-08

    Test case: 1. Create a titanium project 2. Include the attached project 3. Run the following app.js
       var win = Ti.UI.createWindow({
       	backgroundColor:'white'
       });
       var label = Ti.UI.createLabel();
       win.add(label);
       win.open();
       
       // TODO: write your module tests here
       var service = require('com.service');
       Ti.API.info("module is => " + service);
       
       label.text = service.example();
       
       Ti.API.info("module exampleProp is => " + service.exampleProp);
       service.exampleProp = "This is a test value";
       
       alert(service.getServiceRefCount());
       if (Ti.Platform.name == "android") {
       	var proxy = service.createExample({
       		message: "Creating an example Proxy",
       		backgroundColor: "red",
       		width: 100,
       		height: 100,
       		top: 100,
       		left: 150
       	});
       
       	proxy.printMessage("Hello world!");
       	proxy.message = "Hi world!.  It's me again.";
       	proxy.printMessage("Hello world!");
       	win.add(proxy);
       }
       
    Expected Result: You should get an alert with '0' as its message Actual Result: The app hangs on splash screen with a class not found exception in log.
  4. Allen Yeung 2013-04-08

    https://github.com/appcelerator/titanium_mobile/pull/4125 EDIT: backport: https://github.com/appcelerator/titanium_mobile/pull/4127
  5. Vishal Duggal 2013-04-08

    Need backport to 3_1_X as well
  6. Eric Merriman 2013-04-09

    Verified fixed with: Mac OS 10.8.3 Xcode 4.6 CLI: 3.1.0-cr Alloy: 1.1.0-cr Appcelerator Studio, build: 3.1.0.201304082106 Titanium SDK version 3.1.0.v20130409124549 Nexus 4 4.2.1

JSON Source