Following the Readme of the https://github.com/flutter/plugins/tree/master/packages/firebase_messaging I set up the IOS and Android firebase. On Android it works but when I try to install the app by running "flutter run" on IOS, it gets stuck at installing it and I can't open it.
After I took the screenshot a new line appeared under "Installing and launching", "Configuring firebase for this app..." (or something like this).
I tried deleting the pods and set up again.
I tried deleting the app so it can be installed again.
I that at some point during the "Installing and launching..." the app tries to open but closes back immediately. Is it a crash? How do I get some sort of info regarding this? Thank you!
check these two things:
For iOS, the firebase_messaging functionality only works on real devices, it doesn't work on the simulator. (it does work in Android emulator)
Run open -a xcode ios/ and try to build the app there (⌘R), there will be more details on possible errors, specially regarding filling in the Signing section. Even if it's not signing, you will find out what it is, and after fixing it, the flutter cli will resume running without issues.
Related
I've been having hard times with my old Windows laptop while developing React Native apps so I moved to MacOS laptop. I installed Android Studio and Xcode (including Xcode command line tools). Then I initialized a blank expo managed project. I started both on Android Emulator and iOS simulator. Android one worked out with an ádb´ error (or maybe warning). But on the other hand, iOS simulator did nothing. There's no Expo Go app installed on iOS device, so it can not launch my app using it. I don't get any error or warning related to this problem, so I can't trace the problem.
I have tried deleting global expo folder located at ´~/.expo/´, I also tried to give 777 (all permissions) on that folder to my current user.
I tried uninstalling and reinstalling expo package globally.
I made sure I have selected Xcode command line tools on ´Xcode -> Preferences -> Locations -> Xcode 13.2.1 (13C100)´
I tried to launch different iOS devices like (iPhone 6, 8, 13, iPod etc.)
I tried clearing cache and starting expo with ´sudo npm start --clear-cache´
I have been trying to solve this for at least 2 hours tried everything possibly related to my problem but none of them did work. There's one thing I don't understand though. Even though I used different iOS device simulators the Expo Metro Bundler showed this ´› Opening exp://10.42.33.15:19000 on iPhone 8´ output. I have tried iPhone 13, iPhone 6, iPod etc. but this was the same output for different devices. Here's some screenshot related to probem:
https://www.youtube.com/watch?v=dvuZn6gX_Q4
This tutorial video on YouTube helped me solve my problems. I think I was missing a few things:
I haven't granted required privacy permissions on my Mac for Xcode, Android Studio and VS Code. Open System Preferences > Security & Privacy > Go Privacy Tab > Give Full Disk Access to Xcode, VS Code, Android Studio, Terminal and Watchman (Watchman is not required, but I have also installed it for solving a problem before)
You should to launch both your Android and iOS simulators before starting your expo application. Simply go to Android Studio and launch your device. To launch iOS device use bash and type open -a simulator.
If you don't have Expo Go app installed on your iOS simulator then you should first install it before starting your expo app. To install it use expo client:install:ios command.
Start your app by using expo start command. Type i and a or click on Run on iOS simulator and Run on Android device/emulator buttons to launch your app on devices.
NOTE: If you app gets stuck at New update available, downloading... stage then you can start your expo app with cleaned cache using expo start -c command. It was helpful for me.
NOTE 2: You may need to use sudo command on some of the commands I've mentioned, I'm not sure which ones are required or not.
I run into the same issue every time when I tried to set it up on a new laptop.
Its fixed after the installation of xCode cli.
Take a look at this - https://docs.expo.dev/workflow/ios-simulator/
I fixed similar issue by hard restarting simulator
Top menu -> Device -> Erase All Content And Settings...
I am currently building a react native app using expo.
However, I needed to use cocoapods, which is why I am now using Xcode.
Since I have switched to Xcode, there has been a difference between my local debugging builds (that I run to a USB connected iPhone) vs the builds that get pushed to TestFlight.
After doing some digging I have found that it may be due to the debug vs release schemes in Xcode.
From what I've see it seems that the difference should really just be in performance, file sizes, and some other aspects, but not what the app actually does and displays like in my case.
To test, I made a change on my app's homepage to simply have the text, UPDATED.
As expected, when ran with the debug scheme, the UPDATED text shows up, but when ran with the release scheme, it does not.
How do I get these to sync up and have the release build recognize the changes I make as I am certain I do not want to push a debug build to the app store?
Things I have tried:
Removing/cleaning Build folder and rebuilding
Updating Xcode
Running on another device
Building/running with expo (this did something, but it just causes the app to crash, assuming it is because of the cocoapods)
Versions:
react-native: 0.61.5
Xcode: 11.4.1
macOS: 10.15.3
Thank you
I have fixed the issue.
I found that by running expo publish in the terminal and then building with the release archive scheme in Xcode, it notices the changes.
Now why that is required (maybe it isn't), I am unsure of.
If anyone has an any additional insight, it would be greatly appreciated.
EDIT: So it looks like when I run expo publish it updates the app.bundle and app.manifest. This must be what the release scheme looks at when building.
So I run my react-native iOS app from Xcode or react-native run-ios like normal. The server starts and says "Loading dependency graph, done." as normal. The app boots up on the simulator and then stays on the splash screen for around 20 seconds then crashes. It never seems to be able to find the development server and it doesn't print any error in the console.
I haven't been able to solve this issue for the life of me today. I've tried every solution I can find. If someone has any insight, please let me know. Thanks!
How to overcome :
cd ios && pod install
then Open in Xcode (project.xworkspace)
then clean and build project with Xcode
Ok so I ended up updating everything... Xcode, react native (0.60), my node_modules, and cleaned and rebuilt and finally everything works properly now. Updating took some time but it was worth it.
Annoying problem here for my Flutter app: iOS13.3, Xcode11.3 on a physical iPhoneX. The iOS-Simulators all work. The problem is only happening on a physical device. The Flutter App freezes at startup (i.e. at Installing and Launching... step) ! Any ideas ??
My flutter doctor -v does not bring any problems. Also tried flutter clean and flutter upgrade. But nothing seems to fix the problem...
If I run the App from Xcode (Runner.xcworkspace) then everything works as well. Only from VSCode and Flutter, I can no longer launch my physical iPhoneX.
Also, when uploaded to TestFlight, the App freezes at App Start ! (grey screen freeze). Therefore Apple App Store rejects all Flutter Apps for now ! Very annoying.
I am not sure if the Installing and Launching... freeze is related to the TestFlight and App Store Problem !! Might as well be...
This fixed the issue for me:
Run the app from Xcode.
Disable WiFi on iPhone.
Run from Android Studio.
Turn on WiFi on iPhone once the launch process has completed.
This is a workaround solution
I was having this issue. I uninstalled the app from my device, opened the project in xcode, ran some build cleaning thing that appeared in the yellow triangle warning area, then built the app via xcode. Then uninstalled the app from device again. Then ran via android studio and it worked.
Basically, it is because of might some files
For me, this worked
Follows these steps: Go to Flutter > bin > cache
and delete the Artifact folder
Try executing the command: killall -9 dart and retry.
As in my case, I use one of following solutions to fix the issue:
#1. close WiFi on mac, then run from Android Studio; OR
#2. close WiFi on both mac and iphone, then run from Android Studio; OR
#3. enable hotspot on iphone and connect it from mac, then run from Android Studio;
I'm starting with React Native, everything works fine in the iOS simulator. I decide to try it on a device.
The app launches, I can play with it, I close/reopen it around 4 or 5 times, and then somewhat randomly the app crashes on Launch Screen (the one with "Powered By React Native"). It just shows the screen, and the app crashes to the iPhone home screen.
Any idea how I can further debug that?
Edit: I added Bugsnag in my AppDelegate.m, but bugsnag doesn't detect anything when the app crashes.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
[BugsnagReactNative start];
// Rest of code
}
I came across this issue today. Read a few SO posts and saw one guy mentioned if your app launches and hangs on the splash screen and then crashes with no error it probably has something to one of your npm dependencies.
After digging deeper i saw the react packager was throwing the error
This error is caused by a #providesModule declaration with the same name across two different files.
To fix
check / clean up dependencies(check for same name declerations)
rm -rf node_modules
rm -rf $TMPDIR/react-*
npm i
This can caused by many issues it seems. Recently this happened to me and I had to search a bit to find out the exact reason.
I'll save you guys the trouble by sharing few places I read
- https://github.com/facebook/react-native/issues/14500#issuecomment-348063910
- https://github.com/facebook/react-native/issues/17276#issuecomment-357538208
In my case it was a library issue which I have not linked properly.
-https://github.com/ivpusic/react-native-image-crop-picker/issues/204
So yeah! my point is, it's something we have done or not done. Bit more research would help!!!
I had a similar issue. My application crashed on emulator device every time I ran the application without throwing any error in the console.
Here are a bunch of solutions that might work:
Solution 1 Remove node_modules
rm -rf /node_modules
npm install
Solution 2 Remove /android/app/build directory (This one worked for me)
rm -rf /android/app/build
After this, uninstall the application from emulator device and then run your application again
I was also facing the same issue on real device and it was working fine on simulator. So, i have fixed my issue by given solution
Solution: i have uninstall the application from simulator and then installed it again. This time it showed me the actual error on simulator that i had made mistake.
I finally solve this error by running the app in release mode from xcode
goto Product->Scheme and then click edit Scheme
Select run from left side menu
change Debug to Release
untick Debug executable
now clean the project and run your app in release mode
Some time you have to delete pods and install again after doing above
look for your error in xcode console in my case VS code has imported a Library I just have to remove that import
I had this problem also, what triggered it for me though was updating react and react-native.
I did a build after updating and then I experienced the same issue. I downgraded back to the previous versions of react and react-native, but that didn't work for me.
I tried removing node modules, and reinstalling, that didn't help. Then I noticed that when I was building: react-native run-ios,
the files in ios/build were not updating
I rm -rf ios/build/ and then I react-native run-ios and the ios/build folder populated. My app ran fine after that.
For me lottie package was creating problem. After removing the package able to launch the package.
Make sure by checking the last package/packages installed
In my case it was the Firebase GoogleService-info.plist file which was missing that is supposed to be present in your project.xcodewrkspc when opened using XCode. Adding that resolved the issue.