Fork me on GitHub
#cljsrn
<
2018-11-27
>
codonovan17:11:35

@kenny744 I've seen your final issue when bundling manually. IIRC your --bundle-output is incorrect try /usr/src/app/android/app/build/generated/assets/react/release/index.android.bundle I think you can confirm this is the problem by unzipping the release apk. My guess is index.android.bundle is not in it

rith8721:11:42

@codonovan thanks for the tip! you were right; there was no index.android.bundle in the apk. the path that worked for me was /usr/src/app/android/app/src/main/assets/index.android.bundle

rith8722:11:27

i managed to resolve the call stack to the following:

com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'goog.string.Unicode = {
        NBSP: " "
      }'), stack:
    <unknown>@2574:14
    [email protected]:14
    [email protected]:47
    [email protected]:79
    global [email protected]:8
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
and then i came across this conversation between @domkm and @ronb at https://clojurians-log.clojureverse.org/cljsrn/2017-06-15. Are there some known issues when using :optimizations :whitespace?

rith8723:11:03

a few more details. using source maps, <unknown>@2574:14 resolves to

goog.provide("goog.string");goog.provide("goog.string.Unicode");goog.define("goog.string.DETECT_DOUBLE_ESCAPING",false);goog.define("goog.string.FORCE_NON_DOM_HTML_UNESCAPING",false);goog.string.Unicode={NBSP:" "};goog.string.startsWith=function(str,prefix){return str.lastIndexOf(prefix,0)==0};goog.string.endsWith=function(str,suffix){var l=str.length-suffix.length;return l>=0&&str.indexOf(suffix,l)==l};
and then metroRe[email protected]:79 resolves to
{ source: '/usr/src/app/node_modules/metro/src/lib/polyfills/require.js',
  line: 152,
  column: 20,
  name: 'moduleIdReallyIsNumber' }
I also noticed that there are two versions of require.js in my node_modules; one under metro/ (which does global.require = metroRequire;) and the other under react-native/ (which does global.require = require;). is this going to be a problem?