Cannot run app on iOS device after upgrading to React Native 0.37 - react-native

I upgraded to React Native v0.37. The iOS Simulator works fine but when trying to run the app on a device I get the error:
[fatal][tid:main] No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.unsanitizedScriptURLString:((null))
Does anyone have a clue why?
Many thanks in advance for your help.

Make sure you are allowing localhost in you Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>

OK, so I had the issue again after upgrading to React Native 0.38.
I ran "react-native bundle --dev false --assets-dest ./ios --entry-file index.ios.js --platform ios --bundle-output ios/main.jsbundle" to do the bundling in a clean way and figured out that there was an error caused by a Babel plugin configuration issue. After cleaning my .babelrc file, the packaging is working perfectly well. It then generates the main.jsbundle, and you have to add it to the project in xcode. After that compilation runs fine.

Related

React Nativ iOS APP is loading black screen instead of main React Native Splash which I designed

I am running react-native APP and try to run ios Part. It's Launch successful but with black screen. Also I can not see any option on Launcher. Please see below image.
See simulator
Again, It's React Native and me want to run on ios simulator
Just to let you know, I solved the problem by myself. I was doing something wrong on info.plist. That was code which was getting issue.
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
</dict>
I just removed that and problem resolved

React Native App Not Displaying console.logs()

After releasing my app for production, I found I wasn't able to view console.logs() anymore no matter what I attempted.
I attempted to reproduce the problem:
Installed latest version of npm
Used create-react-native-app to create a new app.
Added simple button to call a console.log()
Console.log() worked in IOS Simulator
Ran npm run eject.
Opened up Xcode project and ran from inside. Console.logs() are still working.
Removed localhost entry from the NSExceptionDomains.
Edited scheme -> run -> changed from debug to release
Changed jsCodeLocation to jsCodeLocation = [[NSBundle mainBundle] URLForResource:#"main" withExtension:#"jsbundle"];
Rebuilt app. Console.logs() no longer showing, but app loads.
This is at the point where the app is production ready, as per the guidelines of React Native's Building Your App for Production
In hindsight, it probably makes sense that a production build wouldn't show console.logs(), but I'm still posting this in case it helps out anyone else.
If anyone, like me, wants to then get console.logs() back, it's as simple as doing the reverse of the tutorial. Follow these steps closely to return your app to a state where console.logs() will show:
In Xcode, Go to Product -> Scheme -> Edit Scheme -> Run -> set Build Configuration to Debug
In your AppDelegate.m, change the jsCodeLocation to jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:#"index" fallbackResource:nil];
Finally, in your Info.plist, add the code below (use a text-editor for this - not Xcode - by right clicking and then choosing a text-editor of your choice):
Code:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
Close all terminal windows, clean your project, close Xcode, close the simulator, and then launch Xcode again and rebuild your project. The console.logs() will be back.

Share extension not showing up for my existing Universal project

I am adding a share extension to my existing Universal app, but it's never showing up in the shared menu.
xcode 9.3 , Deployment target for Parent app and extension 9.3
Steps for adding xcode
File -> New -> Target-> shareExtesnion
All certificates for share extension + containing app on automatic.
Enable app Groups for bot app and extension.
Select Same app group for app and extension.
Build the app using safari.
build successfull, and safari opens fine, but can't see my App extension on the share sheet.
Then created new sample app with same steps mention above, it works properly.
Things I tried to clear the issue
Created new App group.
Deployment target changed to 11.3
Changed ActivationRule
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ui-services</string>
</dict>
I need your valuable suggestions. Thanks in advance.

Fabric won't let app run

Guys I keep getting this error after running my app! I have no idea why this just started to happen but I can't seem to get it to work now. Anyone know how to fix this?
WatchKit v3 app has disallowed Info.plist key: Fabric
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>mykey</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>MoPub</string>
</dict>
</array>
</dict>
Fabric doesn't support Watch OS 3.
This thread appears to suggest it isn't, and I couldn't find any changes to the documentation to suggest it is.

"Open in" feature in Safari iOS 9 not working

my app uses a feature built into Safari's "Open in" when opening documents. I registered Document type like:
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeName</key>
<string>Microsoft Word</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openxmlformats.wordprocessingml.document</string>
<string>com.microsoft.word.openxmlformats.wordprocessingml.document</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
In iOS 8, everything works fine and I can upload the document in my app. But with the release of iOS 9 this function is not working, Safari allows to open in my application only pdf files. Who knows why it stopped working in iOS 9.
It seems that there was someone in the apple team thinking that this is too useful to be on an apple device and this should only be working to people using Android. And so they removed it. We can only hope that it will come back in a future update.
In iOS 9.1 this feature is working again.