[TIMOB-26329] Hyperloop: Android - Can't instantiate a CoordinatorLayout in SDK 7.3.0
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-08-23T23:48:57.000+0000 |
| Affected Version/s | Release 7.3.0 |
| Fix Version/s | Release 7.3.1 |
| Components | Android, Hyperloop |
| Labels | android, hyperloop |
| Reporter | Luc-Edmond Gaspard |
| Assignee | Joshua Quick |
| Created | 2018-08-20T22:16:11.000+0000 |
| Updated | 2018-08-24T09:30:27.000+0000 |
Description
Hi, since 7.3.0 this example does not work anymore. https://github.com/appcelerator/hyperloop-examples/blob/master/app/controllers/android/nativelayout.js
And if I try to create a CoordinatorLayout directly in hyperloop or in a java module I get this exception:
(main) [222,5668] Exception during instantiation of class 'android.support.design.widget.CoordinatorLayout'
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/coreui/R$attr;
Hello, Thanks for sharing with us. It would be great if you can share a simple test case to reproduce this on our end.
When running with 7.3.0.GA : {noformat} (main) [83,149] Exception during instantiation of class 'android.support.design.widget.CoordinatorLayout' java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/coreui/R$attr; at android.support.design.widget.CoordinatorLayout.const Activity = require('android.app.Activity'); const CoordinatorLayout = require("android.support.design.widget.CoordinatorLayout"); const Color = require('android.graphics.Color'); const win = Ti.UI.createWindow(); const activity = new Activity(Ti.Android.currentActivity); const layout = new CoordinatorLayout(activity); layout.setBackgroundColor(Color.YELLOW); win.add(layout); win.open();Your issue is different to what your comments state. The issue above is about missing
attrvalues in your project that are required to instantiate aCoordinatorLayoutprogrammatically. But if the example from the hyperloop-examples repo does not work anymore, it'd be an actual regression. We need to investigate in that direction. *EDIT*: Here is the actual error:It may be related to the support-library update we did in 7.3.0? Renaming the support library could fix it. cc [~jquick] for a 2nd thought.[ERROR] TiExceptionHandler: (main) [30081,30386] /hyperloop/android.view.LayoutInflater.js:390 [ERROR] TiExceptionHandler: var result = this.$native.callNativeFunction({ [ERROR] TiExceptionHandler: ^ [ERROR] TiExceptionHandler: Error: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout [ERROR] TiExceptionHandler: at LayoutInflater.inflate (/hyperloop/android.view.LayoutInflater.js:390:28) [ERROR] TiExceptionHandler: at /alloy/controllers/nativelayout.js:51:806 [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/nativelayout.js:51:882) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:9) [ERROR] TiExceptionHandler: at ListView.onListViewItemclick (/alloy/controllers/index.js:114:31) [ERROR] TiExceptionHandler: at ListView.value (ti:/events.js:49:21) [ERROR] TiExceptionHandler: at ListView.value (ti:/events.js:101:19) [ERROR] TiExceptionHandler: [ERROR] V8Exception: Exception occurred at /hyperloop/android.view.LayoutInflater.js:390: Uncaught Error: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayoutJust to confirm, I was able to use the example in question with 7.2.0.GA and it is broken on 7.3.0.GA and the latest 7_3_X builds of the SDK. The error message is not very helpful, but certainly Hans' suggestion regarding the updated support libraries is also my suspicion: * https://github.com/appcelerator/titanium_mobile/commit/53da13c4fe * https://github.com/appcelerator/titanium_mobile/commit/86e84eeb39
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10279
PR (7.4.x): https://github.com/appcelerator/titanium_mobile/pull/10281 PR (7.3.x): https://github.com/appcelerator/titanium_mobile/pull/10282
FR Passed. PR's merged.
*Closing ticket.* verified fix in SDK version
7.5.0.v20180823165211,7.4.0.v20180823165354and7.3.1.v20180823165225. Test and other information can be found at: Master: https://github.com/appcelerator/titanium_mobile/pull/10279 7.4.X: https://github.com/appcelerator/titanium_mobile/pull/10281 7.3.X: https://github.com/appcelerator/titanium_mobile/pull/10282