Error when archiving IOS app in react native with error : ld: library not found for -lFBReactNativeSpec - react-native-ios

I cannot build my IOS app. the error says
Showing Recent Errors Only
Library not found for -lFBReactNativeSpec
After investigation, i found that the new version react-native "react-native": "^0.64.0" move the react FBReactNativeSpec folder from
../node_modules/react-native/libraries/FBReactNativeSpec"
to
../node_modules/react-native/React/FBReactNativeSpec"
i have checked the build settings header paths, check the react-native pod script file, and the file FBReactNativeSpec is included
the strange thing is that the application is running normally in debug version and not when trying to product/archive for test flight

I got the same problem, when updating an app that had been generated for IOS 13, when updating to IOS 14 the XCode informed that the minimum for the build should be version 12, and it was for 9.0, trying to generate the build in version 9 and 10, these lib not found errors will occur, when accepting the minimum for version 12 the build was generated without errors.

The "library not found" errors occur most of the time because installing the react-native node package and running "pod install" is often not enough.
The error should go away after running a clean build in xcode using the xcworkspace file. After that, running "npm run ios" or "npm start" in the termal should work again.

Related

"Unknown compiler option 'preserveValueImports'.ts" error when making a sveltekit project

Whenever I create a sveltekit project with tyepscript, I always have the "Unknown compiler option 'preserveValueImports'.ts" appear in the tsconfig.json file. The error appears over the '"strict": true' line as seen in the image.
I'm using typescript version 4.9.4 and have tried to downgrade it to 4.8.4, but the error still persists. This is my first time trying out sveltekit and typescript, so I'm not sure if I installed them wrong, but all I did was installed typescript globally with npm and then created svelte project with pnpm. I also had created the svelte project with npm but the error still appears.
This error was solved on reddit by updating visual studio code to the latest version (1.74.2), as VS code uses the bundled version of typescript by default.

React Native: Failed to install the app. Could not find or load main class org.gradle.wrapper.GradleWrapperMain

I recently started my React Native journey and hit a snag before I could even start to code. I followed the guide by Facebook on how to set up your environment for a React Native project, though I installed java SDK, python and node manually instead of through chocolatey. Installing the react native application on my system went smoothly but when I try to run on my Android Emulator by using the command react-native run-android, I run into the following Error message.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
The system cannot find the path specified.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
The system cannot find the path specified.
Note: I have not made any changed in any file nor deleted anything
Steps to reproduce
Run the command react-native init AwesomeProject
cd AwesomeProject
Ensure Emulator is running then start Metro Bundler with react-native start
Run command react-native run-android in a separate terminal to receive error
Steps taken to resolve
I have tried following multiple issues and queries of others with similar problems to no avail
I tried re-installing everything from scratch to no avail, and creating a new project but the same message appears after hours of re-installation
One person suggested running gradle wrapper inside the project folder, but that too made no difference
Another suggested that a file name gradle-wapper.jar would be missing, but its there in the project folder
I tried loading the Android folder of the react native project in my Android Studio, the gradle starts building but there is still no success when the gradle is built
Packages Installed
Node V12.18.2
Java SDK V8
Python 2.7
Android Studio SDK [Android 10.0 (Q)]
Android SDK Build-Tools (Installed)
Android Emulator (Installed)
Android SDK Platform-Tools (Installed)
Intel x86 Emulator Accelerator (HAXM Installer) (Installed)
Please let me know if any further information is required to understand my problem. Thanks!

Could not install app on device, react-native

I am extremely new to app development. I am facing the following error during the installation of my app on emulator by using the CLI:
Error Message on the Terminal:
Following are the details of my project:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
I don't know what is causing this, and I have tried deleting the gradle (version 2.14.1) multiple times and zipping it again inside the 'gradle' folder. Still It does not seem to be resolved.
How can I solve the problem?
I have the same problem as yours! Because when I first run "react-native run-android", my INTERNET is SLOW and LAG, CORRUPTED. This bad internet connection lets to download a TEMPORARY DAMAGE file gradle....zip.
Solution: The gradle-2.14.1-all.zip was damaged,so it should be replaced with a new gradle-2.14.1-all.zip
Then go to android folder of your react native application
./gradlew clean
Try running the application again

VS 2015 TACO - build broke on Xcode 8 / iOS 10

Here are the issues I encountered and fixed:
Code signing: downloaded the xcode8.js hook and added the following to build.json, per http://www.dpogue.ca/articles/cordova-xcode8.html:
"ios": {
"debug": {
"developmentTeam": "VZ4B5XSP9U"
},
"release": {
"developmentTeam": "VZ4B5XSP9U",
"codeSignIdentity": "iPhone Developer"
}
}
On my Mac, deleted the ~/.taco_home/node_modules/taco-remote-lib/2.2.1 and .../2.2.0 folders, per https://github.com/Microsoft/remotebuild/issues/5.
On my Mac, tried uninstalling and reinstalling remotebuild, and different versions of node and npm (0.12.9 and 4.6, and respective npm versions).
In Visual Studio, tried changing the targeted Cordova version: 6.3.1, 6.2, 6.1.1, and back to 5.4.1.
No matter what I do though, the build gets stuck either on extracted - Extracted app contents from uploaded build request, or building - Updating platform forever.
Earlier, when I tried opening the Xcode project in Xcode on the Mac, it successfully built and deployed the app to the device. I was then facing issues using WebRTC (using cordova-plugin-iosrtc) and it was giving me privacy violation exceptions. I tried adding the cordova-custom-config plugin and appropriate Cocoa keys (NSCameraUsageDescription and NSMicrophoneUsageDescription) per App crashes with __CRASHING_DUE_TO_PRIVACY_VIOLATION__ when trying to access contacts, and then it stopped working altogether.
Can anyone please advise what are the latest versions of all of the components I should be using to make it work again? Some sources advise to use Node 0.12.9 on the Mac, others 0.12.7; most people claim that with Cordova >= 5.3.3, any Node version should suffice, however using Node 4.6 didn't work either.
Thanks in advance for any help!
Update: After performing the brew update etc. as suggested by Jordan, the remote deploy works, but the build sets "Main interface" setting under project's General tab to "NSMainNibFile~ipad", which causes the app to crash on launch, until I open the project in Xcode and clear that field, then an incremental build creates a functioning app.
This is a known issue with Apache Cordova 6.3.1 and for the Visual Studio tools we've been working on a fix for this. To work around the issue for now, you'll need to perform the following steps:
Add a developmentTeam property to the ios build settings in your project's build.json file (an example is shown below).
Set the build.json file's codeSignIdentity property to the static value iPhone Developer.
Setup a before_compile hook in your project to copy the developmentTeam property into the project's platforms/ios/cordova/build.xcconfig file.
The project's build.json file should look something like the following:
{
"ios": {
"debug": {
"developmentTeam": "DEVELOPMENT_TEAM_NAME"
},
"release": {
"developmentTeam": "DEVELOPMENT_TEAM_NAME",
"codeSignIdentity": "iPhone Developer"
}
}
}
To simplify the process, Darryl Pogue published a sample hook that makes the required changes to the project's build.xconfig file based on the build.json example shown above. To use this hook, copy the sample xcode8.js file to your project's hooks folder, and then modify the project's config.xml to execute it before the compilation step using the following code:
<platform name="ios">
<hook type="before_compile" src="hooks/xcode8.js" />
</platform>
Creating a Distribution Build
At this point, the Cordova build process works, and you can run, test and debug your app. Unfortunately, the app isn't being signed with the correct development certificate needed for distribution. In order to sign them with a distribution certificate, you'll need to create an archive of the app by following the instructions found in: Uploading Your App to iTunes Connect.
iOS 10
Developers building Cordova applications for iOS 10 may encounter the following errors:
Http 404: Error mounting developer disk image
Http 500: No devices found to debug. Please ensure that a device is connected and awake and retry.
This is caused by the Mac development environment needing an update to several modules. To fix the issue, on Mac OS, open a terminal window and issue the following command:
brew update && brew upgrade libimobiledevice --HEAD && brew upgrade ios-webkit-debug-proxy ideviceinstaller

Phonegap 3.4.0 fails to build new projects and update old projects

I recently updated phonegap, node, and npm. I have an existing project I previously built with Phonegap version 3.3.0. I then attempted to update my existing project using phonegap platform update ios and received an error stating that the '/platforms' directory does not exist.
I don't think it makes any difference, but I also tried to use the cordova command instead of the phonegap command, but I just get the same error as above. I even created a completely new project with phonegap create Test and I am able to get a project built successfully, but when I try to run/build I get a similar error: Error: /platforms does not exist. Please specify an existing parent folder. [error] /Users/mftcmbp1/.cordova/lib/ios/cordova/3.4.0/bin/create: Command failed with exit code 1 Even stranger, I am able to successfully create a project with the cordova command, build ios and android platforms, and emulate the project, yet I can't do this with the phonegap command like I could before I updated.Any help or suggestions of why this would be occurring will be helpful.
Thanks!
Not sure if there is a bug with Phonegap 3.4.0, but I fixed my issue by uninstalling the latest Phonegap version and installing Phonegap version 3.3.0-0.19.4.
1- you need to 'cd' to your project and add platform first before build
cd Test
2- then add platform
iOS
phonegap platform add ios
android
phonegap platform add android
3- then you can build your project
iOS
phonegap build ios
android
phonegap build android
I ran into this over the weekend, have you tried:
$ mkdir project_directory/platforms
As I remember it, that solved the issue as a hotfix.
The error occured after a project was cloned from github without the platforms directory.
I ran into the same issue, and it looks like an error in the update script, and specifically this file:
node_modules/phonegap/node_modules/cordova/src/util.js
The quick fix is, in the function isRootDir, to change "config.xml" to ".cordova", i.e.:
- if (fs.existsSync(path.join(dir, 'config.xml'))) {
+ if (fs.existsSync(path.join(dir, '.cordova'))) {
The old version identified the base project directory via the existence of the .cordova directory. The new version is incorrectly looking for a directory that contains these three items:
www/
config.xml
platforms/
config.xml should not be in the base directory, it's under www/, which is why it fails.
The script does have fail-safe, which is to look for www/config.xml. However, the way it does this is to continue traversing the tree towards root, and if at any time it finds another www/config.xml, will assume this is a better candidate for the project directory.
In your situation, I'm guessing you have a /www/config.xml off of your root directory, and PhoneGap is erroneously thinking that is your project directory.

Resources