Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): check for inner-class and field name collision #346

Merged
merged 5 commits into from Oct 5, 2020
Merged

fix(android): check for inner-class and field name collision #346

merged 5 commits into from Oct 5, 2020

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Oct 3, 2020

JIRA:
https://jira.appcelerator.org/browse/TIMOB-27915

Summary:
Fixes JS runtime error "Cannot redefine property" caused by Java/Kotlin class having an inner-class and a field with the same name. Will always happen when using the Kotlin "companion" feature.

Test:

  1. Download the hyperloop-examples project.
  2. Add the below dependency to the project's "build.gradle" file.
  3. Add the below line of JS code to the "alloy.js" file.
  4. Build and run on Android.
  5. Verify the app starts up without issue.

./app/platform/android/build.gradle

dependencies {
	implementation 'com.stripe:stripe-android:14.4.1'
}

./app/alloy.js

var CardInputWidget = require("com.stripe.android.view.CardInputWidget");

- Always happens with kotlin classes using the "companion" feature.

Fixes TIMOB-27915
- Build will fail if folder is missing.
@jquick-axway
Copy link
Contributor Author

jquick-axway commented Oct 3, 2020

Building this module with Titanium 9.1.0 or higher causes it to crash on startup for 9.0.x built apps with a linker error. It's happening because we changed our logDeprecation() C++ API.
https://github.com/appcelerator/titanium_mobile/pull/11049/files


I wrote up the regression here: TIMOB-28161


Resolved issue for this module by removing deprecated property getter/setter methods.
It's no longer blocking this PR.

@janvennemann janvennemann added this to the v6.0.3 milestone Oct 5, 2020
@janvennemann janvennemann modified the milestones: v6.0.3, v6.0.2 Oct 5, 2020
@ssekhri
Copy link

ssekhri commented Oct 5, 2020

FR Passed.
Verified on:
Mac OS: 10.15.4
SDK: 9.2.0.GA, 9.2.1.v20201002104158
Appc CLI: 8.1.1
JDK: 11.0.4
Node: 10.17.0

@ssekhri ssekhri merged commit 36320ff into tidev:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants