Run Custom Shell Script [cp] Embed Pods Framework - ios

My Project was building fine before the latest update of xcode.Currently running 10.1 version of xcode and high sierra below are the errors screenshot

It's hard to say what is wrong without script. By error description bad interpreter: Operation not permitted I can have a guess you have syntax error in script or one of commands in script requires sudo.

Related

Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64'

I have created fresh project(Hello World) in KMM followed by their official website. In android it works smooth but when I am trying to run in XCode it's giving errors because of which I am unable to build / run the xcode project. I have attached screenshots and logs for my errors. Somehow xcode scheme is not getting generated in the KMM platform that's what I am guessing.
Can anyone please help me understand what am I missing?
Any help would be appriciated.
Following is my dev env:
Xcode 11.4.1
Android 4.1.2
Kotling Plugin version 1.4.30 (stable)
KMM 0.2.0```
XCode Logs:
> Task :shared:compileKotlinIosX64
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Extracting dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz into /Users/fatin/.konan/dependencies
e: java.lang.RuntimeException: Cannot extract archive with dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz.
> Task :shared:compileKotlinIosX64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:compileKotlinIosX64'.
> Compilation finished with errors
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
1 actionable task: 1 executed
Command PhaseScriptExecution failed with a nonzero exit code ```
[![enter image description here][3]][3]
I reached out to community for this and finally found the solution. Here is the link to that issue which I raised and solved this problem.
If anyone else is going through this same issue it mostly cause of corrupted kotlin file.
Also try checking your cmd line tools in XCode as per comments.
Hope this helps someone. Cheers.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

ionic fails to add iOS platform

when I try the following command in VS Code
sudo ionic cordova platform add iOS
I get an error with the following:
ERROR] An error occurred while running subprocess cordova.
cordova platform add ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I get iOS folder in platforms folder, but how to solve this error ?
First, why are you running with sudo? I would recreate the project in a directory which does not require this. For example ~/dev/myProjectName
Second, when you scroll up it should give a more specific error.
Third, if not have you tried doing as shown and run with --verbose flag?
Fourth, try opening platform/ios project in xCode and running from there. It may give more useful info.

Unity PostProcess Build script fails when running from command line

I am trying to build my project from the command line targeting iOS.
When I build this from the editor, everything works! I have a PostProcess build script that I use.
When I try to build form the command line using the following command:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod BuildScript.BuildIOS -nographics -buildTarget iOS
I am getting an error from my PostProcess build script saying:
Assets/Editor/MyBuildPostprocessor.cs(9,23): error CS0234: The type or namespace name Xcode' does not exist in the namespaceUnityEditor.iOS'. Are you missing an assembly reference?
The line that generates the error is a simple using clause:
using UnityEditor.iOS.Xcode;
So it seems that for some reason, the command line build mechanism does not recognise the UnityEditor.iOS.Xcode assembly, and my PostProcess build script cannot run.
Any ideas?
This is a known case when iOS project is built manually in Unity without errors and fails building on build-server (Unity cloud, Jenkins, TeamCity and others). I think that your case is similar with it. Because if you take a look at the build-server process of building Unity app you'll see that it also uses command line command
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod BuildScript.BuildIOS -nographics -buildTarget iOS
As for build-server issue, the solution is to put all your post-process scripts inside #if UNITY_IOS condition. And it's possible that you've misunderstood the error you get. Unity says that it doesn't understand XCode namespace while trying to include your post-process script inside your build. And of course, Unity can't include XCode namespace because it's available in Unity Editor only.
So try adding #if UNITY_IOS at the very beginning of your post-process source, even before using section and #endif the the very end of the source. In this case Unity won't compile post-process script during building phase, but will call your post-process script after XCode project will be created.
Unfortunately, I couldn't find any information why manual and command line build processes differ.

React native Xcode build error

I am using react native 0.39.2 version, after running on device using xcode 8.2.1 i am getting this error :
Shell Script Invocation Error
../node_modules/react-native/packager/react-native-xcode.sh: line 41: cd: /Users/shafips/Documents/Projects/My: No such file or directory.
any idea.
Remove iOS and Android folders and run
$react-native upgrade
Then
$react-native link
Try running again
Happy Coding!
Solved!.
Yes, Removed spaces from project folders.

Phonegap/Cordova 3.4 update gives multiple errors

After upgrading to Cordova 3.4 from 3.3 I get the following error:
Shell Script Invocation Error Group
Cp: ....../platforms/ios/myproject/config.xml: No such file or directory
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure.
This is relating to the running of cordova/lib/copy-www-build-step.sh from build phases.
This doesn't result in the build to fail, but still concerns me...
Anyone know a fix for this?
BTW the config.xml it can't find definitely exists.
Remove platform and add it back again.
Remove
cordova platform rm ios
Add
cordova platform add ios

Resources