How to debug generic React Native error messages on iOS? - ios

Unless I enable debugging (Esc > Cmd+D > Debug JS Remotely) then I see this error:
Module AppRegistry is not a registered callable module
This also means that I'm unable to view the bundled app on device. If I try to view the app on device, but still use the dev server (remembering to use an IP address in AppDelegate.m instead of localhost) then I instead get this error:
WebSocket connection failed with error Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused"
even though I've verified that I can open the dev server URL in a browser on the device.
I'm not an iOS developer, so maybe this is really obvious, but how do I go about debugging why these errors are happening, or just not having these errors in the first place?

One reason could be App Transport Security that was added in iOS 9. Please see https://facebook.github.io/react-native/docs/running-on-device-ios.html#app-transport-security for reference. You have to add the NSAllowsArbitraryLoads entry to your Info.plist yourself if you didn't use the React Native CLI to generate your project.

Although this doesn't really answer the 'How do I debug these kinds of generic errors' question, I've found out that in my case the problem was that I created my app using an older version of RN (maybe 0.26?) that had a bug in the scaffolding code it creates (which I stupidly ignored at the time when I found i could work around it by enabling debugging) and updating to newer versions of the app hasn't fixed the issue because that doesn't cause the scaffolding to be updated. By creating a fresh app under RN 0.29, and copying my code into it, everything is now working as expected.

Related

bundle identifier build errors xamarin forms ios and ios extention projects

I have been trying to deploy this iOS app for 2 days from visual studio for mac and I have been getting an error stating.
"Found conflicts between different versions of "System.Numerics" that could not be resolved. The reference conflicts are listed in the build log when log verbosity is set to detailed."
This has has changed from Numerics to system.net.http after i removed system.numerics. When I cleaned the project, the error message would switch to warning messages. I cleaned up most of the warning messages.
When I look at the build log this is the build error i actually see.
error MT7006: The App Extension 'OneSignalNotificationServiceExtension' has an invalid CFBundleIdentifier (com.my.app), it does not begin with the main app bundle's CFBundleIdentifier (com.my.app).
I switched over to my windows machine to build the app, it found the same warnings with the version conflicts. But the error it came back with is the MT7006.
Im leaning towards this is real error even on the mac and the other errors are false.
This leads to the question, my ios app and my extension have the same bundle identifier com.my.app, i have even checked the info.plist files in text editors to make sure they match and they do. I have cleaned the project and nothing seems to resolve the situation.
Any guidance is most appreciated.
Your extension cannot have the same id as the main app.

Meteor Cordova iOS HCP fails, log says PNG file already exists when it doesn't

I'm running meteor run ios-device ... and watching the logs in Xcode. I'm using hot code push on localhost to make css changes that show up immediately in the iOS Simulator device. I add user_white.png to the images folder and in css point a url(...) to it. I get this error, which I don't understand, because user_white.png did not "already exist". Even if I stop-start the simulator in Xcode, this error persists. Any ideas what this error means?
2018-07-28 12:48:51.511632-0400 Vium[41847:2439935] Download failure:
Could not link to cached asset: Error Domain=NSCocoaErrorDomain Code=516
"“user_white.png” couldn’t be linked to “images” because an item
with the same name already exists."
...
NSFilePath=/Users/opx/Library/Developer/CoreSimulator/Devices/6E759135-D5E3-
4AC0-AF35-92FCC473A61D/data/Containers/Data/Application/D92D9589-4D22-4006-
8A08-0AC35932E769/Library/NoCloud/meteor/PartialDownload/app/images/user_white.png,
NSUnderlyingError=0x60000024b520 {Error Domain=NSPO
2018-07-28 12:48:51.516594-0400 Vium[41847:2438252] ERROR:
{"line":36,"column":30,
"sourceURL":"http://localhost:12072/plugins/cordova-plugin-meteor-webapp/www/webapp_local_server.js"}
Update:
This is a bug in Meteor -- see https://github.com/meteor/meteor/issues/10181 for details, specifically https://github.com/meteor/cordova-plugin-meteor-webapp/issues/56. This problem causes iOS Meteor Cordova hot code push to fail. In the cases in which it is causing HCP to fail, the answer below is not sufficient, but the problem also occurs in Xcode debugging in ways that are solved by stop/start as described below.
For the record, the answer to this problem is that the error message is a very misleading sounding one, user_white.png is not already existing in a way that's meaningful to the user. The solution is simple enough: stop Xcode/iOS Simulator, stop the Meteor server running on localhost, then rerun meteor run ios-device ....
That rebuild of the server side and subsequent rebuild of the device client in Xcode makes the problem go away. The combination of hot code push and Xcode device simulator apparently don't handle the adding of a new css-referenced image in a way that reports what you really need to know, which is: stop everything and rebuild the app!
Here's the actual answer: a fix has been merged into the meteor code for the cordova-plugin-meteor-webapp plugin, so as of version 1.7.0 of that plugin, this problem is resolved. See the links in my earlier "answer" and also https://github.com/meteor/meteor/issues/10277 for details, but it's fixed in meteor.

Firebase Fabric Crashlytics not sending data to server

I used Crashlytics for a long time since it was under the Twitter umbrella. I'm switching now to the new version integrated with Firebase but I can't get it to work correctly. I think I've done the integration correctly. Everything looks ok. However data doesn't get sent (or received). I think the problem is in this message that I get in the debug console (Xcode).
[Fabric] failed to download settings Error Domain=FABNetworkError Code=-5 "(null)" UserInfo={status_code=403, type=2, request_id=617cbe85f1d8e3c3973b275a8ff08564, content_type=application/json; charset=utf-8}
I believe that for some reason, the SDK is failing to download the configuration settings needed to then connect to the server and send back the crash reports. Firebase looks like is working fine, so it's an issue specific with Fabric/Crashlytics.
I couldn't find any answer to this specific error. Anyone else experiencing this?
To add to this, I can't see the new version of the app appearing in the dashboard. And this update has been released already to the public... with hundreds of thousands of installs already.
For me the problem was that the SDK doesn't recognise automatically the API Key that you should be able to set in the Info.plist.
Instead I had to pass it over to the URL in the build settings. (Old way to do it)...
If your app is running with "App Sandbox" capability, enable the "Outgoing Connections" checkbox.

Lexical or Preprocessor Issue React Native

I'm trying to test my React Native v0.40.0 application on my physical iPhone 6s device. I've been having a ton of issues and not sure why. When building the application, it says it succeeds but shows a fatal error 'cxxreact/JSBundleType.h' file not found under Buildtime errors and the application doesn't get installed onto my phone. Additionally, I managed to install it once a few days ago, but was having issues making api calls since the call was being made to localhost so I believe the fetch() calls weren't resolving correctly. I found this article https://tylermcginnis.com/test-your-react-native-app-on-your-iphone-or-ipad-c632b4beb3ed/ but the AppDelegate.m file is different now so I don't know how to make the modification that everyone is suggesting. Any ideas?
I hit this issue and found answers no where...I wish a had a better solution for you but what worked for me was running react-native upgrade and resetting everything :/

Internal API error

Since few days, every time I try to run my app on my iPhone, I get get this error message "There was an internal API error".
I'm getting this error just with one application only on my iPhone. In fact, there's no problem with the same app on simulator or on my iPad. No problem too with other apps on my iPhone...
I've tried many things mentioned in those threads:
"There was an internal API error." while running an app on any iPhone/iPod-touch device
Xcode 4.4 - There was an internal API error
like remove/re-run the app, reboot iPhone/mac, clear cache, check plist, check profiles, check build settings, restore iPhone.
I'm using xCode 7.1.1 and iOS 7.1.2
Can someone point me on what I forget to check please ?
As per my work and research I got a solution. Since I was preparing the build in manual way from product. In that case my appname.app was copying in folder from which I have to create a build, that app was not copied properly and I prepared the build and installed in my device, in that case I got this error.
I again clean the Xcode prepare the build properly and installed it, it works.
When I rename my project and delete the special character "ç", xCode success to run the app on my iPhone. It might be related to xCode 7, before there was no problem for compiling.
I also had this problem. The way I solved it was by removing the special characters from the Product Name (in Build Settings) - I had an 'æ'. Indeed, it looks related to Xcode 7, because it used to work on previous versions of Xcode.

Resources