I have installed expo Location:
npx expo install expo-location
And whenever I try to use it in my application get an Error
import * as Location from 'expo-location';
console.log(Location) //Leads to an Error when I try to call it
ERROR:
Android Bundling complete 3254ms
ERROR TypeError: undefined is not an object (evaluating 'nativeModule.__expo_module_name__')
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
dependencies in Package.Json:
"dependencies": {
**"expo": "~47.0.9",**
"expo-file-system": "~15.1.1",
**"expo-location": "~15.0.1",**
"expo-updates": "^0.15.6",
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-maps": "^1.3.2",
}
I fixed this Error by doing a re-build using eas
eas build --profile development --platform android
Related
I've been building my expo app but when i try to run it it give a ViewPropTypes error.
I've fixed the error in debug mode by changing the react-native package code by updating it to use
deprecated-view-prop-types and the app runs but when i build it into an apk using eas
the error occurs again.
I think eas installs the broken react-native package which causes the error again.
I've tried adding the fixed react-native code into the git repo hoping that it makes eas use the
fixed react-native package but it failed so i want to know how to make eas compile with the fixed
react-native package.
Here is the link on how to fix the react-native ViewPropTypes error Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'
Here is the log on android when the app crashes01-31 18:26:47.548 18926 18982 E ReactNativeJS: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.01-31 18:26:47.577 18926 18982 E ReactNativeJS: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.01-31 18:26:47.577 18926 18982 E ReactNativeJS: A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
this is error. please help me how to fix it!!! I was clean my cache but It dont work!!!
ERROR TypeError: undefined is not a function, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegis try.runApplication(). Module has not been registered as callable. Registered calla ble JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler , RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is i ncorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegis try.runApplication(). Module has not been registered as callable. Registered calla ble JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler , RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is i ncorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
Delete your node_modules directory and run npm i
For Android cd android && ./gradlew clean && cd .. for iOS remove Podfile.lock (windows) cd android && gradlew clean && cd .. For iOS cd ios && rm -rf Pods && pod cache clean --all && pod install && cd ..
Run react-native start --reset-cache
I have a private gitlab repo (react native module) and i added this repo to my App's package.json.
index file in my private gitlab repo:
ios methods:
android methods:
Now in my App, i install the above module and i call the methods.
App's package.json
App.js
In ios, everything works perfectly fine.
Both "multiply" (HealthLibrary.multiply()] and "requestAuthorization" [HealthLibrary.requestAuthorization()] work fine.
But when i run "react-native run-android", the build is successful but the display is a blank screen with this error in the log
TypeError: null is not an object (evaluating 'nativeModule.requestAuthorization')
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
Why does this error pop up only when i run android??i am not even calling "requestAuthorization" method yet i am unable to build the app in Android.
Any help would be great guys....
In the images you have provided, there seems to be no requestAuthorization method in your android file, only a method called 'getAuthorization'.
When trying to run application written in react-native I've got this errors. Can't google anything like it. The same errors either from android studio in emulator or after using "npx react-native run-android"
UPD. So the solution is to regenerate file index.android.bundle
Full description I've found here - https://medium.com/#adityasingh_32512/solved-unable-to-load-script-from-assets-index-android-bundle-bdc5e3a3d5ff
The main command is
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Error code originally I've got:
E/unknown:ReactNative: Exception in native call from JS
com.facebook.react.devsupport.JSException: Can't find variable: MapPage
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:216)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
Caused by: com.facebook.jni.CppException: Can't find variable: MapPage
c#index.android.bundle:25:260
index.android.bundle:24:60
v#index.android.bundle:2:1474
index.android.bundle:146:70
v#index.android.bundle:2:1474
index.android.bundle:91:132
v#index.android.bundle:2:1474
d#index.android.bundle:2:876
global code#index.android.bundle:439:4
... 7 more
I am running this code when I run node index.js command in CMD it works perfectly but same code is not running when I am using it into firebase cloud function. I might be wrong but not able to find the issue I am searching this issue for 1 week.
this code is working
stripe.customers.create({
email: 'testemail#gmail.com',
}).then((customer) => {
return null;
// functions.firestore.document('data/{card}/payment/{tokenid}').set(customer.id)
});
but this is not working
exports.StripeSource =functions.firestore.document('data/{card}/tokens/{tokenid}').onCreate((user) => {
return stripe.customers.create({
email: 'testemail#gmail.com',
}).then((customer) => {
return null;
// functions.firestore.document('data/{card}/payment/{tokenid}').set(customer.id)
});
});
fire base functions log is
{"#type":"type.googleapis.com/google.cloud.audit.AuditLog","status":
{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":
{"principalEmail":"name.dev#domain.tv"},"requestMetadata":{"requestAttributes":
{},"destinationAttributes":
{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.fun
ctions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/payment
bystripe/locations/us-central1/functions/StripeSource"}
visual studio code terminal report here
C:\Users\Waqas\AndroidStudioProjects\flutter_stripe_payment1\android\functions\functions>firebase deploy --only functions
=== Deploying to 'paymentbystripe'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions# lint C:\Users\Waqas\AndroidStudioProjects\flutter_stripe_payment1\android\functions\functions
> eslint .
+ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
+ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (37.28 KB) for uploading
+ functions: functions folder uploaded successfully
i functions: updating Node.js 8 function StripeSource(us-central1)...
! functions[StripeSource(us-central1)]: Deployment error.
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'stripe'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/index.js:5:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Functions deploy had errors with the following functions:
StripeSource
To try redeploying those functions, run:
firebase deploy --only functions:StripeSource
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
C:\Users\Waqas\AndroidStudioProjects\flutter_stripe_payment1\android\functions\functions>
You did not install stripe. I recommend you to look your dependencies in package.json and add "stripe":"^6.20.0". Any new version of this will do the trick.
Finally run Firebase deploy. I hope this helps.
This error means the deployment script could not find the stripe package. You probably have the stripe module installed globally but it is not referenced explicitly in your package.json for this project.
When you deploy firebase function the deployment script takes your package.json and pulls all of the dependencies. It will not look for dependencies installed locally on your machine.
Either add the stripe dependency manually to the package.json or run:
npm install stripe
then verify the stripe module has been added to your package.json file.