React-Native app can build for debugging but not for archiving - ios

I'm trying to archive my iOS app which works fine when I build for debugging via xcode but when I try to archive the app I get the following errors which I'm not sure what's causing it

I think the real reason for failure would be a little above in the listing, which cannot be seen here.
I had similar kind of issue when updated react native to version 0.54.2 the iOS archive stopped working.
My error message was something like:
A problem occurred while trying to fetch the minifier. Path: "metro-minify-uglify" Cannot find module 'uglify-es'
And the problem was that my react native project only had uglify-js in node-modules (I quess that the new react native needed the uglify-es). So I installed that with:
npm install uglify-es --save
And after that I did (not sure if these are needed) xCode->clean project, shutdown xCode, delete Library->Developer->Xcode->DerivedData, restart Xcode and archive started working again.

Related

React Native, iOS, trying `yarn run ios` and I get RCTAppDelegate.h not found

Trying to build a React Native iOS app, and while I got it running fine using Android, trying to get it running on iOS has been a bit of a nightmare.
I created this base react native app, back in Sept 2022, doing the typical npx react-native init <projectname> and was working on android mostly (I use a linux box, and I have to use Teamviewer to connect to a mac to build the iOS apps).
I had my app working fine in android and iOS, and then added the Zoom Video SDK and everything went to hell. Got it working fine in Android, and tried to take my changes and build them in iOS but I couldn't get it to work, and seemingly got my iOS project corrupted, so I tried to create a fresh iOS project, by basically created a same-named project in a different directory, and replacing the <projectname>/ios with the new base ios project.
Of course, I did this Jan 2023, so it's the new architecture, and the AppDelegate.h tries to import the RCTAppDelegate.h file instead of React/RCTBridgeDelegate.h
I do my usual yarn install go into the ios directory and pod install and then try to do a yarn run ios and it tells me it can't find RCTAppDelegate.h
Anyone solve this yet? The React-Native docs aren't up to date with their github repo
I got the same error, i solved it by opening the .xcworkspace instead of opening .xcodeproj
I also cleaned the build folder by
Product --> Clean Build folder
and then it successfully built the app.

React native on XCode build successful but stuck at '100% on simulator

I tried to build my expo project on XCode so I ejected that and open in XCode using xed ios. but when I tried to build it and run it show's me that build was successful but on simulator it stuck at '100%' and wont run. also on XCode I receive this:
"expo-updates must be configured with a valid update URL or scope key."
how can I solve this issue?
It is an expo issue, the solution found is:
Sign in to your expo account in expo-cli and it will configure expo-updates properly when you eject. You can fix this on an already ejected project after signing in by running expo eject --no-install.
Or
Check JWrubel comments for the same issue below.
I was able to get around this issue without doing expo login by editing ios/<AppName>/Supporting/Expo.plist and adding a key for EXUpdatesURL like so:
<key>EXUpdatesURL</key>
<string>https://example.com</string>
This causes the update check to fail, but the build to succeed. I tried setting EXUpdatesEnabled to false and EXUpdatesCheckOnLaunch to NEVER, but I didn't find those had any impact on the process.

Why does xCode cannot build my flutter app with 'sqflite' not found error

I'm trying to build my Flutter app for iOS using xCode and got error:
.../ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'sqflite' not found
When I'm trying to build application with flutter with command
flutter build ios
I don't have any problem. Application build successfully.
I tried to delete Pod directory in ios folder and then install pods from scratch
flutter pub get
pod install
How to fix this problem with xCode?
XCode gives this type of Error like Module 'something' not found, when sometimes the problem is somewhere else.
So, what I did is after running flutter build ios command, I didn't try to run it in XCode. Because it was giving these errors.
So, I archived the app and tried to publish in App Store Connect. Then I found the real issue/bug on my code.
App store doesn't support transparent logo or app icon. This was the bug in my case.
So you can try to archive and publish to app store connect. It may show you the real reason.
Change your target Destination to > Any iOS Device
This work for me
"I found the solution,
In the existing project, once you guys add sqflite dependencies
Profile file in IOS folder will not generate code
we need to remove Podfile in ios
rm ios/Podfile
and run the project again, it works for me."
Credit:thanks to viroth-geek

React Native app not running in XCode iOS simulator

I try to make my first steps using React Native. Development for Android (on Windows host) works. Now I wanted to test iOS, and tried to set up a development environment on a MacBook Pro.
Problem: React Native starts the iOS simulator, and then nothing happens any more. The simulator runs OK, but my React native app won't start.
What do I need to do to get my React Native installation going?
More Info:
I set up XCode and React Native according to the docs on the MacBook Pro running OSx 10.13.2 (High Sierra). XCode was installed and tested successfully, including the simulator.
When I installed Node.js I deliberately picked an older version (containing npm 4.2.0), since forums say that React Native does still have problems with npm 5. I also installed Homebrew and Watchman, like stated in the docs.
To initialize an empty project, I used
create-react-native-app HelloWorldProject
and a projet structure got created in my Documents folder.
If I finally fire up my "Hello World" test app using
cd HelloWorldProject
sudo react-native run-ios
the system responds:
Starting packager ...
Starting simulator ...
and then nothing happens. The simulator does indeed start (boot --> apple logo --> progress bar --> IOs start screen), but nothing happens afterwards.
Edit
I have given up on React Native for several reasons, I leave this question here for documentary purposes, but I cannot verify or accept any answer, I don't have a React Native development environment any more.
It's probably because you used sudo. /.expo/ is owned by root. Try to change the ownership with
sudo chown -R `whoami` ~/.expo
Refer https://github.com/react-community/create-react-native-app/issues/422
Even everything in your app seems fine, sometime you face the issue that the app is taking too much time to load either through terminal or Xcode. If there is no any other specific issue with your project, the following solution works most of the time:
Go to your app folder and then go to 'iOS' folder.
Delete 'Podfile.lock' and 'Pods' folder.
Execute the following command in Terminal from your 'ios' folder, that will bring back the 'Podfile.lock' and required Pods will be installed to 'Pods' folder:
pod install
Delete the 'build' folder in your 'iOS' folder.
Run the following command in terminal:
react-native run-ios
While the terminal is running, open '.xcworkspace' in your 'ios' folder in Xcode.
The above steps will make sure it will be build your react native project newly and will run on the simulator.
Thanks
Wasantha Wijayaratna

Xcode - clang failed with exit code 1. Plugin cause?

I'm getting an odd error in Xcode when I try to Archive my app.
I'm using Ionic and the Ionic CLI tools. The app has been built for Android and is in beta on the Google Play store.
In Xcode I get this error:
clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/de.appplant.cordova.plugin.email-composer/APPEmailComposer.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
So it looks like there is some error with the de.appplant email plugin. The email plugin works in Android but it doesn't work in Ionic View on iOS. I wasn't sure if this was that the plugin isn't Ionic View compatible or not.
Anyone have any ideas?
Upate:
I uninstalled this plugin and I now get the same error, but from a different plugin!
clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/com.danielcwilson.plugins.googleanalytics/UniversalAnalyticsPlugin.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
So I'm pretty sure this is a plugin problem.
Anyone have any idea why or how I can fix it? I'm installing from the command line on a Mac with the standard cordova commands as seen on ngCordova.
edit: To be clear - those folders do not, indeed, exist. The plugins work fine in Android though...
Your error is quite strange, probably something happened to the structure folders..
I would try doing something like this:
Before doing this test make a backup copy of platforms/ios.
cd my-folder-app/
ionic platform remove ios
ionic platform add ios
Now should need to copy from backup and paste for example the icons, splash screens to the fresh platforms/ios folder and re-apply some eventual changes that you did.
ionic build ios
And then open xcode:
Run the app on emulator or device to test if works
Disconnect the device
Select the schema and iOS Device
If you need configure the schema, first you need to edit it:
Select Archive from the left panel, and from the right there is Build Configuration: select Release if you want publish the app or Debug if you want install the app on a test device. And click Close.
From the top menu: Product > Archive
Good luck!
UPDATE:
To be sure that your errors not depends to the ionic project make this test please:
cd projects-folder/
ionic start myTestApp tabs
cd myTestApp/
ionic platform add ios
ionic build ios
And now follow the same steps on xcode to archive the app.
I never really found out what was happening.
What I did was remove the iOS platform and re-add it. This just created more errors although for some reason the correct folders were there. I also then found my Android build wouldn't work.
I removed everything and re-added it all, updating Ionic too.
Then XCode would open but freeze. Hard freeze. The only way to quit it was to force close the Mac. I even uninstalled XCode and re-installed it. Same thing.
Finally I used the command line to erase all presets in XCode so it would open fresh without any projects loaded. Now it works, and the Android version seems to be working too.
I've no idea where the error started and so I can't rightly tag anyone as correct as that would be misleading. The solution: cleans and burn, start again. :)

Resources