[TIMOB-25430] Android - java.lang.NoClassDefFoundError in TextFieldProxy
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-10-26T17:50:06.000+0000 |
Affected Version/s | Release 6.3.0, Release 6.2.2 |
Fix Version/s | n/a |
Components | Android, Hyperloop |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Joshua Quick |
Created | 2017-10-23T11:50:20.000+0000 |
Updated | 2017-10-26T17:50:06.000+0000 |
Description
Reported by the community on Slack:
art: Rejecting re-init on previously-failed class java.lang.Class<ti.modules.titanium.ui.widget.TiUIEditText>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/NestedScrollingChild2;
[INFO] : art: at org.appcelerator.titanium.view.TiUIView ti.modules.titanium.ui.TextFieldProxy.createView(android.app.Activity) (TextFieldProxy.java:73)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:499)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485)
[INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485)
[INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView() (TiViewProxy.java:485)
[INFO] : art: at void org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(org.appcelerator.titanium.view.TiUIView) (TiViewProxy.java:523)
[INFO] : art: at org.appcelerator.titanium.view.TiUIView org.appcelerator.titanium.proxy.TiViewProxy.handleGetView() (TiViewProxy.java:507)
[INFO] : art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:105)
-Not 100 % sure if this is caused by the core or Hyperloop itself-, I requested some more infos from the reporter.
*EDIT*: It seems like it works with SDK 6.2.0 but not with 6.2.2 and 6.3.0.
Attachments
File | Date | Size |
---|---|---|
error.txt | 2017-10-23T13:07:48.000+0000 | 405198 |
So some extra info on the issue (thanks Hans for creating it for me): Node (just updated today): v6.11.4 SDK - 6.2.0 (works), 6.2.2 (error above) 6.3.x (error above) MacOS Everything works on 6.2.0, but anything newer and it breaks with the above message repeating many times.. This is on launch after building and deploying the app not during the build.
This is very likely related to the scroll-view fixed [~jquick] is already working on, as [~mark.henderson@snagr.co.uk] was able to confirm that the issue happens with a textfield inside a scrollview.
[~mark.henderson@snagr.co.uk], Are you using any 3rd party modules? If so, can you list them out please? I suspect what's happening is that a module your app is using includes an old version of a Google support library which is overwriting the one Titanium uses. As of Titanium 6.2.2, our TextField and TextArea features require Google Support library v26.0.0 which Titanium normally includes with the app. Normally, a module should not include a Google support library to avoid conflicts like this and I suspect one of them is. Thanks.
Yes I am using the following modules for Android:
I've also included my AndroidManifest.xml:
I've included the manifest in case there is an issue around the minSDK / targetSDK I'm using as I just had to move targetSDK from 23 > 25 to work with the latest Hyperloop release.
[~mark.henderson@snagr.co.uk], I looked up those modules and none of them appear to include Google's support library. Since you're using hyperloop, are you adding any JAR or AAR files to your project? That is, do you have any JAR or AAR files under the "./platform/android" directory in your project? If the answer is "no" to the above question, then we'll need to get a reproducible test project from you, because we're unable to reproduce this issue.
Sorry I'm HK timezone, so takes a while to reply.. Yes I have AAR files from Intercom (https://github.com/intercom/intercom-android) See screenshot here: https://imgur.com/a/oJdWC Maybe the support ones are optional and that's causing the conflict? Thanks
Hui, that are many support-libraries. Since 6.2.2 (I think), we bundle the latest support-libraries with the SDK already, so external ones should not be required anymore. If the Intercom SDK requires them, they likely updated their SDK by now as well, so you might wanna try to remove the colliding ones.
[~mark.henderson@snagr.co.uk], Please remove the following AAR files from your project: - appcompat-v7-25.0.1.aar - design-25.0.1.aar - recyclerview-v7-25.3.1.aar - support-compat-25.3.1.aar - support-core-ui-25.3.1.aar - support-core-utils-25.3.1.aar - support-fragment-25.3.1.aar - support-media-compat-25.3.1.aar - support-v4-25.3.1.aar - support-vector-drawable-25.3.1.aar The above libraries are already included in Titanium and we'll do our best to keep-up with the newest versions of Google's support libraries. We're currently using v26.0.1 as can be seen here... https://github.com/appcelerator/titanium_mobile/tree/6_3_X/android/modules/appcompat/lib https://github.com/appcelerator/titanium_mobile/tree/6_3_X/android/modules/compat/lib https://github.com/appcelerator/titanium_mobile/tree/6_3_X/android/modules/design/lib I'm pretty sure removing the above mentioned AAR files will work. If you can let us know if it solved your problem, then that would be great. Thanks!
I can confirm that removing those files allows the app to run. Thanks!