Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28161] Android: Modules built with 9.1.0 and using deprecated getter/setter property methods will crash on 9.0.x apps

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionUnresolved
Affected Version/sRelease 9.1.0
Fix Version/sRelease 9.3.0
ComponentsAndroid
Labelsandroid, build, module, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-10-03T05:16:27.000+0000
Updated2020-11-23T16:38:14.000+0000

Description

*Steps to reproduce:*

Download the [ti.map](https://github.com/appcelerator-modules/ti.map) module.

CD to folder: ./ti.map/android

Do an appc ti sdk select 9.1.0 or higher Titanium version.

Build via: appc run -p android --build-only

Set up an app with Titanium 9.0.3.GA and built "ti.map" module.

Build and run on Android.

Notice the app crashes on startup with a linker error.

*Cause:* If a module's Java method is assigned both a Kroll.method annotation and Kroll.getProperty/Kroll.setProperty annotation, then the code generation will inject a C++ logDeprecation() function whose signature has changed as of 9.1.0 (we've added a 3rd argument). https://github.com/appcelerator/titanium_mobile/pull/11049/files *Work-Around:* If you are using both Kroll.getProperty and Kroll.method annotations on the same Java method, then remove the Kroll.method since support for this is deprecated. You must also do the same for setters.
@Kroll.getProperty
@Kroll.method  // <- Remove this annotation
public String getName() {
	return "";
}

@Kroll.setProperty
@Kroll.method  // <- Remove this annotation
public void setName(String value) {
	mName = value;
}

Comments

  1. Joshua Quick 2020-11-10

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12259
  2. Christopher Williams 2020-11-23

    merged to master and backport PR merged to 98_3_X for 9.3.0 target.

JSON Source