React-Native / XCode : Build Failing for ffmpeg - xcode

Trying to build a react-native app for ios, but build is failing due to problem below:
ld: in /Users/tialifouroohi/Desktop/GitHub/SocialNetworkWrapper-ReactNative/InstagramClone/ios/Pods/mobile-ffmpeg-https/libavcodec.framework/libavcodec(aacencdsp.o), building for iOS Simulator, but linking in object file built for free standing, file '/Users/tialifouroohi/Desktop/GitHub/SocialNetworkWrapper-ReactNative/InstagramClone/ios/Pods/mobile-ffmpeg-https/libavcodec.framework/libavcodec' for architecture x86_64
React-Native version: 0.63.2
XCode Version: 12.4
Build Target ios version: 13.6
What can I change or do to make the build succeed?

Add this line in Podfile:
pod 'react-native-ffmpeg/https-lts', :path => '../node_modules/react-native-ffmpeg'
Disable auto-linking in react-native.config.js like this:
"react-native-ffmpeg": {
platforms: {
ios: null,
},
},
Now run
pod install
Try this code ,it may fix your issue .

Related

Flutter project Pod install issue in ios side

I have trying to pod install flutter project in iOS side..but i am unable to install the pod in iOS side
its error show
[!] Invalid Podfile file: no implicit conversion of nil into String.
Fixed It by deleting the Podfile and Podfile.lock in ios folder and then run:
flutter run
or
flutter build ios
That way flutter will generate the new Podfile for flutter

Pod install fails for Flutters video_editor example

I am able to clone and run flutter video_editor https://github.com/seel-channel/video_editor
in both the iPhone and Android
.
However, if I copy its example part, it works in Android but not on iPhone (physical). Ipod install fails. Please see attached screenhsot.
I am using all the same versions of everything, for the example part as well as the clone part.
Podfile
platform :ios, '9.3'
pubsec.yaml
video_editor:
path: ^1.8.0
helpers: ^1.1.1
image_picker: ^0.8.4
video_player: ^2.2.6
macOS Monterey
version 12.1
xCode version 13.1
It's work for me.
I download example from video editor.
Then in pubspec.yaml file I changed following
# video_editor:
# path: ../
video_editor: ^1.2.2
Then I fire command flutter pub get and pod install it's getting same error you want.
Then after I change platform :ios, '9.3' to platform :ios, '12.1' in pod file and changed deployment info 9.0 to 12.1 in target(Like below image) then fire commane pod install and it's work fine.

Xcode XCBuild support error for ionic build

I have a ionic project that I am trying to build on iOS.
When running ionic build ios, it gives this error:
FIXME: Implement XCBuild support for macros in overriding parameters
with condition sets:
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
Error: Error code 1 for command: xcodebuild with args:
-xcconfig,/Users/Person/ProjectA/platforms/ios/cordova/build-debug.xcconfig,-project,ProjectA.xcodeproj,ARCHS=i386,-target,ProjectA,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Person/ProjectA/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Person/ProjectA/platforms/ios/build/sharedpch
I have tried:
Remove platform and add platform
Change CODE_SIGN_IDENTITY[sdk=iphoneos*] from iPhone Distributor to iPhone Developer in build-release.xcconfig
Re-did signing from xcode to try both automatic and manual signing
but all were not successful.
I am running:
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.9.4
ios-sim version: 5.0.8
Node Version: v4.4.7
Xcode version: Xcode 11.1 Build version 11A1027
It is an old ionic version but able to run on my old macbook air (OS: High Sierra). I am now using a new macbook air (OS: Mojave) and trying to setup the environment.
Any suggestions?
I was getting this error after re-adding the iOS platform to my project with cordova#8.1.2/cordova-ios#4.5.4, even with a build.json file included in my project. I manually upgraded to cordova-ios#5.1.1 (by specifying the version in the cordova platforms add ios#5 command) and the error went away.

I cant get my ionic app to open in iOS emulator

My new ionic app won't run in the iOS emulator.
Its a fresh install of ionic and Xcode, these are my steps:
npm install -g ionic
ionic start myApp tabs
ionic cordova platform add ios
ionic cordova build ios
ionic cordova emulate ios
Then I get the following error:
No target specified for emulator. Deploying to undefined simulator
/localhost/myApp/platforms/ios/build/emulator/MyApp.app/Info.plist
file not found.
According to this thread (Fresh Ionic Fails to Emulate iOS 12 - Info.plist file not found) it should work with the following command:
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
But then I get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
And then according to this thread (Issues starting iOS simulator from CLI) it should work by updating ios-sim like this:
cd platforms/ios/cordova && npm install ios-sim#latest
But I still get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
Ionic:
ionic (Ionic CLI) : 4.10.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.0.1
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
The problem lie with ios-sim package which couldn't detect running simulators.
Updating to 8.0.1 with the following steps resolved the issue for me.
force update ios-sim to a working version
IMPORTANT needs to be done from inside the platforms/ios/cordova directory.
cd platforms/ios/cordova && npm install ios-sim#8.0.1
check if devices are now listed, takes a few seconds
ionic cordova emulate --list
installs appscript if not installed already
ionic cordova build ios
try to deploy to simulator
ionic cordova emulate --release --prod --livereload ios -- --buildFlag="-UseModernBuildSystem=0"
This will find any running simulator and deploy the app
Try just building the project and then running it from Xcode instead first.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Then open the platforms/ios folder in Xcode and you'll be able to run it from there plus see any errors there may be with the project. When you eventually decide to push the app to the store you'll need to do this anyway.
EDIT
Then try targeting a specific emulator:
ionic cordova emulate ios --list get list of available targets to copy into the next command.
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1" example targeting iPhone XR.
The issue is related to a breaking changes on Xcode 10 not already reflected on ios-sim. You can check on ion-sim repo issue "List empty of devices simulator with Xcode 10".
The issue have already been fixed but is waiting for a new release submission.
You can continue running your App on emulator directly from Xcode.

Cordova ignores the specified architecture when building on IOS

I'm trying to build the PhoneRTC demo on IOS after managing to get it to work on Android and web browser (OS X 10.10.2 Yosemite, XCode 6.1.1, Cordova 4.2.0 and my iPad is running iOS 8.1). My iPad is plugged in. I followed the installation steps for IOS:
In General, change Deployment Target to 7.0 or above
Go to Build Settings and change:
a. Valid Architectures => armv7
b. Build Active Architecture Only => No
c. Runpath Search Paths => $(inherited) #executable_path/Frameworks
d. Objective-C Bridging Header => [ProjectName]/Plugins/com.dooble.phonertc/Bridging-Header.h
e. Embedded content contains Swift Code => yes
I repeated steps 4a. - 4c. for the CordovaLib project as well.
When I run cordova build ios, the build fails. In the console, I see this:
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/Francis/Desktop/PhoneRTC/PhoneRTC/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
SHARED_PRECOMPS_DIR = /Users/Francis/Desktop/PhoneRTC/PhoneRTC/platforms/ios/build/sharedpch
VALID_ARCHS = i386
This seems to indicate that cordova is ignoring the valid architectures I just specified. I tried rebooting my PC and my iPad also but that didn't help. cordova build ios --archs="armv7" doesn't work either.
Buiding from within XCode works, but that's not what I want since it skips the cordova build process.
Any idea how to tell/force Cordova to build against the architecture (armv7) I specified?
Use an xcconfig configuration fileDuring automated build, I create the file after my build script adds the iOS platform:
echo 'ARCHS=armv7 arm64' >> ${CURR_DIR}/platforms/ios/cordova/build-release.xcconfig
An excerpt from build logs:
> cordova build ios --device --release
...
Build settings from configuration file '/Users/xxx/git/xxx/platforms/ios/cordova/build-release.xcconfig':
ARCHS = armv7 arm64
CODE_SIGN_IDENTITY = XXXX
ENABLE_BITCODE = true
PROVISIONING_PROFILE = XXXX
VALID_ARCHS = armv7 arm64
My suggestion is to use cordova prepare and then build from Xcode.
cordova prepare copies files and config settings but does not modify the native code or try to run the standard build process.
This is a common build path that I have used with all of my iOS/Cordova projects and seems to work well.
According to this SO answer this is the solution (worked for me)
When you build you can specify what type of build to do:
cordova compile --device
or for i386:
cordova compile --emulator

Resources