Cannot get initial React Native App to Run - reactjs

Description
I can't get an initial React Native app to run, following a basic tutorial. The error seems to have to do with UIUserInterfaceIdiomCarPlay.
Reproduction Steps and Sample Code
Following the tutorial here https://facebook.github.io/react-native/releases/0.23/docs/tutorial.html#content
I created a new React Native project react-native init AwesomeProject
Then went into the directory, and ran react-native run-ios
Note I also tried from Xcode, and the myriad fixes online, but still no dice. This is the error I got:
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?
case UIUserInterfaceIdiomCarPlay:
^~~~~~~~~~~~~~~~~~~~~~~~~~~
UIUserInterfaceIdiomPad
In module 'UIKit' imported from /Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:12:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:5: note: 'UIUserInterfaceIdiomPad' declared here
UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI
^
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: duplicate case value 'UIUserInterfaceIdiomPad'
case UIUserInterfaceIdiomCarPlay:
^
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here
case UIUserInterfaceIdiomPad:
^
2 errors generated.
Additional Information
React Native version: 0.42.3
Platform: iOS
Development Operating System: MacOS
Dev tools: Xcode, command line

Someone was recently facing the same problem with that error message Use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?. He commented out lines 26 & 27 from node_modules/react-native/React/Base/RCTPlatform.m and apparently got it to work. It might be related to using an outdated version of Xcode

Related

Type error: cannot find module '...' or its corresponding type declarations

I've been trying to deploy my next.js app on Vercel, but got "Type error: cannot find module '...' or its corresponding type declarations" error. My guess is it happened with local module(React Component) and .tsx and .ts files. Because I didn't get this error when I deployed the last version without typescript.
In development mode the app able to find the modules and execute the code effectively without any error.
I don't know if I'm too late. I hope this help :)
Vercel deploy / build fail. "Failed to compile. Type error: Cannot find module ... or its corresponding type declarations
or you can look at this issue
https://github.com/vercel/next.js/issues/11742

TypeError: undefined is not an object (evaluating 'row[OBJECT_COLUMN_NAME] = key') | React Native

Currently, I am building a MobileApp with React-Native and everything works fine until today :/
Unfortunately today the app throws an error (see below) after a successful build!
[TypeError: undefined is not an object (evaluating 'row[OBJECT_COLUMN_NAME] = key')]
BUT this error only appears in the normal mode -> if I switch to the debug mode everything is working without any further problems.
So after that, I started searching the trigger of this error and I found it (See below)
Your_App/node_modules/react-native/Libaries/polyfills/console.js (Line 449)
But as you can see that isn't from me it's from React-Native and I am not able to resolve this problem
After a long research on the internet, I couldn't figure out anything because nobody has got this error yet :/
But I think it has something to do with the newest react-native firebase version 6.0.0 (https://invertase.io/blog/react-native-firebase-v6)
Because it fails near there (See below)
Note: After recreating the app (not hard with git) the error appears again after a while :/
Note: A empty App still works on my engine
What do I use:
react-native 0.61.5
java 13
(All used libraries)
I would appreciate help ^^
Thank you
After I filled my code completely with console.logs... I found out that React Native does not work with console.table in non debug mode.
This is easily fixed by using console.table only when the app is in debug mode. Just check if the debug mode is enabled ^^
const isDebuggingEnabled = (typeof atob !== 'undefined');
That's it

error trying to load the config "relay" for the macro imported from "babel-plugin-relay/macro"

We are trying to upgrade our react project to latest packages including relay (7.0.0). Our application builds and works but we are getting this error message in the console (during build) on every file where we import graphql from 'babel-plugin-relay/macro'. We are doing exactly like documented here adding relay
The error is "There was an error trying to load the config "relay" for the macro imported from "babel-plugin-relay/macro. Please see the error thrown for more information." It is coming from \node_modules\babel-plugin-macros\dist\index.js in getConfig( ).
To understand how other projects were configured, I downloaded another sample relay project / installed it and it had the same problem. Interesting enough there was this recent post in that app's issues list error loading config
The solution noted worked for me (adding that noted .babel-plugin-macrosrc.yml file with empty relay plugin?) but I am not understanding why this is needed or what was causing this seemingly benign error message?

Uncaught SyntaxError: Use of const in strict mode in chrome 40

Our ReactJS application created using create-react-app is not getting indexed in google. Upon investigation, found out that google crawler is using Chrome v40 engine to parse client side apps. So I got hold of Chrome 40 and tried to load the page. I got an error in console saying
Loading chunk 13 failed. Uncaught SyntaxError: Use of const in strict
mode.
I tried to apply polyfill (babel polyfill as well as some others) but this error is not going away.
Any advise? Is there anything I can do to make create-react-app to correctly transpile the code to Chrome 40 compatible ?
The issue happened because i was using a component which was not compatible. https://github.com/yahoo/react-stickynode. It worked perfectly after i removed this.

Android builds failing with compilation errors

Im trying to build my app for android. It is setup for notifications. If I build with version 3.4 it gets the following error:
/tmp/x/WordTime1/src/main/java/com/codename1/impl/android/AndroidImplementation.java:4576: error: cannot find symbol
notification.setLatestEventInfo(activity, contentTitle, contentBody, contentIntent);
^
symbol: method
setLatestEventInfo(Activity,String,String,PendingIntent)
location: variable notification of type Notification
/tmp/x/WordTime1/src/main/java/com/codename1/impl/android/PushNotificationService.java:110: error: cannot find symbol
notif.setLatestEventInfo(this, value, "", contentIntent);
^
symbol: method setLatestEventInfo(PushNotificationService,String,String,PendingIntent)
location: variable notif of type Notification
If I build with latest, it gets this error:
/tmp/x/WordTime1/src/main/java/com/codename1/social/GoogleImpl.java:112: error: cannot find symbol
GoogleSignInAccount acct = result.getSignInAccount();
and many more from the com/codename1/social package.
Thank you
Sam
You should build with the latest as 3.4 is ancient by now (we are past 3.8).
The problem with the Google Signin relates to the old Google Plus login support which Google removed. You need to remove the build hints related to that and switch to the new Google Login functionality mentioned in the developer guide.
I mentioned the problems with the Google Connect switch in the blog a while back.

Resources