[TIMOB-28161] Android: Modules built with 9.1.0 and using deprecated getter/setter property methods will crash on 9.0.x apps
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | Release 9.1.0 |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | android, build, module, regression |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-10-03T05:16:27.000+0000 |
Updated | 2020-11-23T16:38:14.000+0000 |
Description
*Steps to reproduce:*
CD to folder:
Do an
Build via:
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 aKroll.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;
}
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12259
merged to master and backport PR merged to 98_3_X for 9.3.0 target.