UIExplorer app doesn't work on android
The red error screen comes up with TypeError: expected dynamic type int64', but had typedouble'. What follows pretty much reflects the following.
I/ActivityManager(21180): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.facebook.react.uiapp/.UIExplorerActivity bnds=[288,367][384,479]} from pid 21410
E/unknown:React(18329): Exception in native call from JS
E/unknown:React(18329): com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `int64', but had type `double'
E/unknown:React(18329): at com.facebook.react.bridge.ReadableNativeMap.getInt(Native Method)
E/unknown:React(18329): at com.facebook.react.uimanager.CatalystStylesDiffMap.getInt(CatalystStylesDiffMap.java:67)
E/unknown:React(18329): at com.facebook.react.views.drawer.ReactDrawerLayoutManager.updateView(ReactDrawerLayoutManager.java:82)
E/unknown:React(18329): at com.facebook.react.views.drawer.ReactDrawerLayoutManager.updateView(ReactDrawerLayoutManager.java:38)
E/unknown:React(18329): at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:53)
E/unknown:React(18329): at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:182)
E/unknown:React(18329): at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:137)
E/unknown:React(18329): at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:574)
E/unknown:React(18329): at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:622)
E/unknown:React(18329): at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
E/unknown:React(18329): at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:114)
E/unknown:React(18329): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
E/unknown:React(18329): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
E/unknown:React(18329): at android.view.Choreographer.doFrame(Choreographer.java:543)
E/unknown:React(18329): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
E/unknown:React(18329): at android.os.Handler.handleCallback(Handler.java:733)
E/unknown:React(18329): at android.os.Handler.dispatchMessage(Handler.java:95)
E/unknown:React(18329): at android.os.Looper.loop(Looper.java:136)
E/unknown:React(18329): at android.app.ActivityThread.main(ActivityThread.java:5050)
E/unknown:React(18329): at java.lang.reflect.Method.invokeNative(Native Method)
E/unknown:React(18329): at java.lang.reflect.Method.invoke(Method.java:515)
E/unknown:React(18329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/unknown:React(18329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/unknown:React(18329): at dalvik.system.NativeStart.main(Native Method)
W/GraphicBufferMapper(18329): registerBuffer(0x57f346e0) failed -22 (Invalid argument)
E/GraphicBuffer(18329): unflatten: registerBuffer failed: Invalid argument (-22)
I/ActivityManager(21180): Timeline: Activity_windows_visible id: ActivityRecord{42536860 u0 com.facebook.react.uiapp/.UIExplorerActivity t26} time:429453557
I/ActivityManager(18329): Timeline: Activity_idle id: android.os.BinderProxy@41e50c60 time:429453657
I also had to alter the build.gradle file to compile project(':ReactAndroid') rather than compile 'com.facebook.react:react-native:0.11.+'
I also had to npm install event-target-shim.
The Movies example app works fine, once I had altered its build.gradle file similarly.
Granted, this is an alpha release, but I did hope that the examples would work easily enough.
@jpcours I had problems running this but after using compile project(':ReactAndroid') as you suggested, I was able to run UIExplorer on Android without any problems. I didn't do npm install event-target-shim though. Thanks for your tip.
Just noting here that it is not currently possible to simply change the pre-compiled dependency to 0.12. Doing so creates this error. TypeError: expected dynamic typestring', but had type object'
E/unknown:React(10385): Exception in native call from JS
E/unknown:React(10385): com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `string', but had type `object'
E/unknown:React(10385): at com.facebook.react.bridge.ReadableNativeMap.getString(Native Method)
E/unknown:React(10385): at com.facebook.react.uimanager.CatalystStylesDiffMap.getString(CatalystStylesDiffMap.java:72)
E/unknown:React(10385): at com.facebook.react.views.toolbar.ReactToolbarManager.updateView(ReactToolbarManager.java:92)
E/unknown:React(10385): at com.facebook.react.views.toolbar.ReactToolbarManager.updateView(ReactToolbarManager.java:38)
E/unknown:React(10385): at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:53)
E/unknown:React(10385): at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:182)
E/unknown:React(10385): at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:137)
E/unknown:React(10385): at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:574)
E/unknown:React(10385): at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:622)
E/unknown:React(10385): at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
E/unknown:React(10385): at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:114)
E/unknown:React(10385): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)
E/unknown:React(10385): at android.view.Choreographer.doCallbacks(Choreographer.java:580)
E/unknown:React(10385): at android.view.Choreographer.doFrame(Choreographer.java:549)
E/unknown:React(10385): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
E/unknown:React(10385): at android.os.Handler.handleCallback(Handler.java:739)
E/unknown:React(10385): at android.os.Handler.dispatchMessage(Handler.java:95)
E/unknown:React(10385): at android.os.Looper.loop(Looper.java:135)
E/unknown:React(10385): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/unknown:React(10385): at java.lang.reflect.Method.invoke(Native Method)
E/unknown:React(10385): at java.lang.reflect.Method.invoke(Method.java:372)
E/unknown:React(10385): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/unknown:React(10385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
As mentioned before, building from source seems to be the way to get UIExplorer example working on master for now.
We will fix this with the upcoming 0.13-rc.
This is due to version mismatch between the JS (from the github repo) and the Android artifacts which are pulled from Maven Central based on UIExplorer's build.gradle. Updating build.gradle locally makes the error go away.
As this is causing quite some confusion I'll make the Android sample apps build from source, like we do on iOS. The disadvantage is that you need the NDK installed and the build is slower that way.
@mkonicek I already tried that and it didn't work. I had master at 9f1dab6.
I just tried again with master at 6f04687436. I still had to modify UIExplorer's build.gradle file, because it still depends on the 0.11.+ version. I tried putting 0.12.+, and I tried compiling from source.
This time it worked, but only when compiling rn from source, as expected.
Good to know! I'm making it so that all samples build from source to prevent issues like this one.