tidev / hyperloop.next

Hyperloop Next version (we forgot the version number at this point)
Other
7 stars 4 forks source link

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

Closed jquick-axway closed 3 years ago

jquick-axway commented 3 years ago

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");
jquick-axway commented 3 years ago

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.

ssekhri commented 3 years ago

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