Fork me on GitHub
#cljsrn
<
2016-01-27
>
alwx12:01:12

Hello everybody. I can't run my Android APK. I use re-natal. I've succesfully created release APK-file (lein prod-build, and everything from there: https://facebook.github.io/react-native/docs/signed-apk-android.html#content), but I see this error when I start my application

alwx12:01:01

Don't you know what may be the reason of this problem? Thanks.

pesterhazy13:01:26

that probably means that the javascript wasn't loaded or threw an exception

pesterhazy13:01:41

it didn't get to the point where it registers the application in react

alwx13:01:08

but it works perfectly in debug mode

alwx13:01:16

and, of course, the worst thing is that stack trace is absolutely useless

pesterhazy14:01:38

is the problem due to advanced compilation (google closure)}

drapanjanas14:01:43

In re-natal project 'lein prod-build' compiles in mode :simple

alwx14:01:09

yep, I use :optimizations :simple

alwx14:01:20

will update re-natal and try again

drapanjanas14:01:29

I admit have not tried the whole way building APK, but strange it does not work. Need to try it...

alwx14:01:38

will try to build APK now simple_smile

drapanjanas14:01:12

How do you register application? registerRunnable? Latest re-natal generates code which use registerComponent. Same way as in normal JS examples, so with latest re-natal you have better chances

alwx14:01:06

I tried registerRunnable and registerComponent, no difference

alwx14:01:37

my init metod in android.core looks this way now:

(defn ^:export init []
  (dispatch-sync [:initialize-db])
  (fn []
    (.registerRunnable ui/app-registry "DealsChecker" #(mount-root))))

drapanjanas14:01:20

with latest re-natal it looks smth like

(defn init []
  (dispatch-sync [:initialize-db])
  (.registerComponent ui/app-registry "luno" #(r/reactify-component app-root)))

drapanjanas14:01:32

which should be analogous to what they do in JS ReactNative:

AppRegistry.registerComponent('MoviesApp', () => MoviesApp);

drapanjanas14:01:28

but, do not know if this is somehow related

pesterhazy14:01:46

@alwx, doesn't that just defined a fn without calling it?

pesterhazy14:01:12

@alwx, I'd guess that's the problem

pesterhazy14:01:33

just remove the (fn [] )

alwx14:01:21

oh super-stupid mistake

alwx14:01:49

I've pushed my changes to Frappe. It works much better now, I promise simple_smile https://github.com/niftylettuce/frappe

pesterhazy15:01:25

you're welcome

alwx15:01:20

one more interesting problem

alwx15:01:23

$ re-natal use-figwheel
Cleaning...
Cannot read property 'length' of undefined

drapanjanas15:01:04

Please run re-natal upgrade

drapanjanas16:01:45

Also please check the release notes, for versions of re-natal in between. There might be some manual steps needed

drapanjanas16:01:19

For example require-img macro was removed. Now normal js/require should be used for images

rnandan27316:01:12

Which version of react-natal should be used 0.17.0 gives erros but 0.4.4 works fine, but 0.4.4 doesn't support react-native-material-design.

rnandan27316:01:48

I get errors like RCTVibration and RCTAdSupport compilation errors

drapanjanas16:01:37

Official react-native set up guide says that you need xcode 7.0 or higher. Maybe the problem

rnandan27316:01:55

will update and try out

alwx22:01:52

Luno (https://github.com/alwx/luno-react-native) has been updated — now it uses the latest version of re-natal and contains detailed instructions of how to build it and run properly. Thanks @drapanjanas for PR. I've also improved it a bit, and you may say thanks to me, too :) Hope you will find it useful, guys!

jurgen_photek22:01:16

@alwx, just pulled and have it working locally now!

alwx22:01:51

@jurgen_photek: cool. congratulations!

seantempesta23:01:02

Does the react developer tools for chrome plugin work with clojurescript? I can’t get the tab to show up during debugging.