maxs15 / react-native-spinkit

A collection of animated loading indicators for React Native
MIT License
2.36k stars 300 forks source link

Android Release failed to find module #9

Closed chuyeoh closed 8 years ago

chuyeoh commented 8 years ago

Hi, i am new to RN and am facing this issue when i packaged my android project APK (Running on debug works fine)

During runtime, i get a com.facebook.react.modules.core.JavascriptException: Requiring unknown module "react-native-spinkit",

I am using the latest ReactNative 0.23.1

Is there any advice in facing this issue?

Full stack trace below

E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
com.facebook.react.modules.core.JavascriptException: Requiring unknown module "react-native-spinkit", stack:
        t@2:387
i@2:177
<unknown>@720:131
t@2:511
i@2:177
<unknown>@710:297
t@2:511
i@2:177
<unknown>@645:278
t@2:511
i@2:177
<unknown>@640:387
t@2:511
i@2:177
<unknown>@638:180
t@2:511
i@2:177
<unknown>@637:83
t@2:511
i@2:177
<unknown>@636:1490
t@2:511
i@2:177
<unknown>@635:131
t@2:511
i@2:177
<unknown>@371:345
t@2:511
i@2:177
<unknown>@11:80
t@2:511
t@2:240
i@2:177
<unknown>@871:9

at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:90)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:78)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:266)
at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:183)
at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:62)
at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:421)
at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:148)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:187)
at java.lang.Thread.run(Thread.java:818)
jerson commented 8 years ago

Same here +100000

E/ReactNativeJS( 2531): Requiring unknown module "react-native-spinkit"
E/ReactNativeJS( 2531): undefined is not an object (evaluating 't(496)["default"]')
E/AndroidRuntime( 2531): FATAL EXCEPTION: mqt_native_modules
E/AndroidRuntime( 2531): Process: com.setbeatnative, PID: 2531
E/AndroidRuntime( 2531): com.facebook.react.modules.core.JavascriptException: Requiring unknown module "react-native-spinkit", stack:
E/AndroidRuntime( 2531): t@2:387
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): <unknown>@531:131
E/AndroidRuntime( 2531): t@2:511
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): <unknown>@502:327
E/AndroidRuntime( 2531): t@2:511
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): <unknown>@501:131
E/AndroidRuntime( 2531): t@2:511
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): <unknown>@500:131
E/AndroidRuntime( 2531): t@2:511
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): <unknown>@499:180
E/AndroidRuntime( 2531): t@2:511
E/AndroidRuntime( 2531): t@2:240
E/AndroidRuntime( 2531): i@2:177
E/AndroidRuntime( 2531): renderScene@373:545
E/AndroidRuntime( 2531): value@385:2514
E/AndroidRuntime( 2531): value@376:1648
E/AndroidRuntime( 2531): _renderScene@232:15702
E/AndroidRuntime( 2531): <unknown>@232:16136
E/AndroidRuntime( 2531): render@232:16010
E/AndroidRuntime( 2531): _renderValidatedComponentWithoutOwnerOrContext@129:5075
E/AndroidRuntime( 2531): _renderValidatedComponent@129:5203
E/AndroidRuntime( 2531): mountComponent@129:1482
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountChildren@184:1243
E/AndroidRuntime( 2531): initializeChildren@183:486
E/AndroidRuntime( 2531): mountComponent@183:1794
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountChildren@184:1243
E/AndroidRuntime( 2531): initializeChildren@183:486
E/AndroidRuntime( 2531): mountComponent@183:1794
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountChildren@184:1243
E/AndroidRuntime( 2531): initializeChildren@183:486
E/AndroidRuntime( 2531): mountComponent@183:1794
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): mountComponent@129:1567
E/AndroidRuntime( 2531): mountComponent@107:164
E/AndroidRuntime( 2531): a@125:117
E/AndroidRuntime( 2531): perform@110:494
E/AndroidRuntime( 2531): u@125:267
E/AndroidRuntime( 2531): perform@110:494
E/AndroidRuntime( 2531): batchedUpdates@104:456
E/AndroidRuntime( 2531): a@105:318
E/AndroidRuntime( 2531): renderComponent@125:1216
E/AndroidRuntime( 2531): R@15:469
E/AndroidRuntime( 2531): i@297:120
E/AndroidRuntime( 2531): run@296:356
E/AndroidRuntime( 2531): runApplication@296:881
E/AndroidRuntime( 2531): value@25:3580
E/AndroidRuntime( 2531): <unknown>@25:1799
E/AndroidRuntime( 2531): k@25:435
E/AndroidRuntime( 2531): value@25:1771
E/AndroidRuntime( 2531): 
maxs15 commented 8 years ago

hmmm weird...could it be because the main file is called index.ios.js ? Could you try to rename it index.jsand update the main property of the package.json accordingly ?

jerson commented 8 years ago

yes, this was the problem :D :D :D :D 👍 i just renamed to index.js

maxs15 commented 8 years ago

Awesome :) I'm going to push a fix

maxs15 commented 8 years ago

Fix just landed in the new version 0.0.9, let me know if everything is working.

mahlon-gumbs commented 8 years ago

Hi, I'm running into an issue similar to this. Using v0.0.9 but still on RN v0.17. Works fine in iOS but getting the error on android.

Error: Requiring unknown module "react-native-spinkit/index.js"

I know it's an old version of RN but we can't upgrade right as this moment. Could that be the cause of this? Again...iOS version is fine...just android giving issues.

maxs15 commented 8 years ago

Have you tries the last version 0.0.9 ?

mahlon-gumbs commented 8 years ago

Yes, this is with v0.0.9

chuyeoh commented 8 years ago

0.0.9 works for me. But I am using 0.23.1 the latest release.

I did face with a other issue but it was caused by my babel env not declared correctly.

Thanks for your help On 13 Apr 2016 12:56 am, "Mahlon Gumbs" notifications@github.com wrote:

Yes, this is with v0.0.9

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/maxs15/react-native-spinkit/issues/9#issuecomment-208948069

mahlon-gumbs commented 8 years ago

@chuyeoh What was the issue with your babel env? Maybe I have something similar? Unfortunately we can't upgrade right now. Is there a minimum version of react native that this lib supports? Perhaps that can be listed in the readme for future reference if that's the case.

chuyeoh commented 8 years ago

Could you provide your stack trace?

In cmd line BABEL_ENV=react-native react-native bundle .... On 13 Apr 2016 2:20 am, "Mahlon Gumbs" notifications@github.com wrote:

@chuyeoh https://github.com/chuyeoh What was the issue with your babel env? Maybe I have something similar? Unfortunately we can't upgrade right now. Is there a minimum version of react native that this lib supports? Perhaps that can be listed in the readme for future reference if that's the case.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/maxs15/react-native-spinkit/issues/9#issuecomment-208988396

mahlon-gumbs commented 8 years ago

Thanks, I'll check my babel config.

The actual call that errors out:

var Spinner = require("react-native-spinkit")

js stack trace

ExceptionsManager.js:63 Requiring unknown module "react-native-spinkit/index.js"handleException @ ExceptionsManager.js:63handleError @ InitializeJavaScriptAppEngine.js:80ErrorUtils.reportFatalError @ error-guard.js:28requireImpl @ require.js:31require @ require.js:21scenes./portfolio.componentLoader @ routerConfig.js:160Router.getRouteForURL @ router.js:47_reactNative2.default.createClass.renderNestedScene @ index.js:69_reactNative2.default.createClass.render @ index.js:60ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext @ ReactCompositeComponent.js:763ReactCompositeComponentMixin._renderValidatedComponent @ ReactCompositeComponent.js:785ReactCompositeComponentMixin._updateRenderedComponent @ ReactCompositeComponent.js:721ReactCompositeComponentMixin._performComponentUpdate @ ReactCompositeComponent.js:702ReactCompositeComponentMixin.updateComponent @ ReactCompositeComponent.js:612ReactCompositeComponentMixin.performUpdateIfNecessary @ ReactCompositeComponent.js:538ReactReconciler.performUpdateIfNecessary @ ReactReconciler.js:115runBatchedUpdates @ ReactUpdates.js:151Mixin.perform @ Transaction.js:140Mixin.perform @ Transaction.js:140assign.perform @ ReactUpdates.js:94flushBatchedUpdates @ ReactUpdates.js:175Mixin.closeAll @ Transaction.js:213Mixin.perform @ Transaction.js:154ReactDefaultBatchingStrategy.batchedUpdates @ ReactDefaultBatchingStrategy.js:66enqueueUpdate @ ReactUpdates.js:208enqueueUpdate @ ReactUpdateQueue.js:24ReactUpdateQueue.enqueueSetState @ ReactUpdateQueue.js:233ReactComponent.setState @ ReactComponent.js:75_callee$ @ index.js:17tryCatch @ runtime.js:62invoke @ runtime.js:338prototype.(anonymous function) @ runtime.js:95tryCatch @ runtime.js:62invoke @ runtime.js:138(anonymous function) @ runtime.js:146tryCallOne @ core.js:37(anonymous function) @ core.js:123JSTimersExecution.callbacks.(anonymous function) @ JSTimers.js:79JSTimersExecution.callTimer @ JSTimersExecution.js:69JSTimersExecution.callImmediatesPass @ JSTimersExecution.js:127JSTimersExecution.callImmediates @ JSTimersExecution.js:142(anonymous function) @ MessageQueue.js:118guard @ MessageQueue.js:38__callImmediates @ MessageQueue.js:118(anonymous function) @ MessageQueue.js:92guard @ MessageQueue.js:38invokeCallbackAndReturnFlushedQueue @ MessageQueue.js:90onmessage @ debuggerWorker.js:39

mahlon-gumbs commented 8 years ago

More insight.

If we hardcode the absolute path when requiring react-native-spinkit (and also hard code the paths to the modules used inside react-native-spinkit) it works. Seems there is a path issue at play here (maybe due to the older version of ReactNative we are running?). Why it manifests only on Android, I'm not sure.

mahlon-gumbs commented 8 years ago

Problem resolved. Must have been something in our path. Cleaned and repackaged and all is well again in android.

maxs15 commented 8 years ago

Great ! 👍 Glad you found the issue. I'm closing this issue now as the issue appear to be resolved