Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25430] Android - java.lang.NoClassDefFoundError in TextFieldProxy

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2017-10-26T17:50:06.000+0000
Affected Version/sRelease 6.3.0, Release 6.2.2
Fix Version/sn/a
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterHans Knöchel
AssigneeJoshua Quick
Created2017-10-23T11:50:20.000+0000
Updated2017-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

FileDateSize
error.txt2017-10-23T13:07:48.000+0000405198

Comments

  1. Mark Henderson 2017-10-23

    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.
  2. Hans Knöchel 2017-10-23

    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.
  3. Joshua Quick 2017-10-23

    [~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.
  4. Mark Henderson 2017-10-24

    Yes I am using the following modules for Android:
            <module platform="android">ti.paint</module>
               <module platform="commonjs">ti.cloud</module>
               <module platform="android">ti.imagefactory</module>
               <module platform="android">ti.compression</module>
               <module platform="android">dk.napp.downloadmanager</module>
               <module platform="android">ti.cloudpush</module>
               <module platform="android">fh.imagefactory</module>
               <module platform="android">com.boxoutthinkers.reqstorageperm</module>
               <module platform="android" version="5.5.0">com.mirasense.scanditsdk</module>
               <module platform="android">hyperloop</module>
       
    I've also included my AndroidManifest.xml:
       <?xml version="1.0" encoding="UTF-8"?>
       <manifest android:installLocation="preferExternal" android:uiOptions="splitActionBarWhenNarrow" android:versionCode="143" android:versionName="4.132.0" package="uk.co.foo.foomobile" xmlns:android="http://schemas.android.com/apk/res/android">
       	<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
       	<uses-sdk android:targetSdkVersion="25" android:minSdkVersion="16"/>
       	<application android:debuggable="false" android:largeHeap="true" android:icon="@drawable/appicon" android:label="Foo" android:name="FooApplication" android:theme="@style/LightDarkBar">
       		<service android:name="com.appcelerator.analytics.APSAnalyticsService" android:exported="false"/>
       		<activity android:name="io.intercom.android.sdk.activities.IntercomMessengerActivity"/>
       		<activity android:name="com.intercom.input.gallery.GalleryLightBoxActivity"/>
       		<activity android:name="com.intercom.input.gallery.GalleryInputFullScreenActivity"/>
       	</application>
       	<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
       	<uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
       	<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
       	<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
       	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
       	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
       	<uses-permission android:name="android.permission.CAMERA"/>
       	<uses-permission android:name="android.permission.INTERNET"/>
       	<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
       	<uses-permission android:name="android.permission.WAKE_LOCK"/>
       	<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
       	<uses-permission android:name="android.permission.READ_CALENDAR"/>
       	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
       	<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
       	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
       	<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
       	<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
       	<uses-permission android:name="android.permission.VIBRATE"/>
       	<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS"/>
       	<uses-permission android:name="uk.co.foo.foomobile.permission.C2D_MESSAGE"/>
       	<permission android:name="uk.co.foo.foomobile.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
       	<uses-feature android:name="android.hardware.camera" android:required="false"/>
       	<uses-feature android:name="android.hardware.telephony" android:required="false"/>
       	<uses-feature android:name="android.hardware.LOCATION" android:required="false"/>
       	<uses-feature android:name="android.hardware.location.GPS" android:required="false"/>
       	<uses-feature android:name="android.hardware.location.NETWORK" android:required="false"/>
       	<uses-feature android:name="android.hardware.TOUCHSCREEN" android:required="false"/>
       </manifest>
       
    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.
  5. Joshua Quick 2017-10-24

    [~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.
  6. Mark Henderson 2017-10-25

    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
  7. Hans Knöchel 2017-10-25

    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.
  8. Joshua Quick 2017-10-25

    [~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!
  9. Mark Henderson 2017-10-26

    I can confirm that removing those files allows the app to run. Thanks!

JSON Source