Failing to build an iOS app built using Cordova / Ionic using Azure DevOps - ios

Trying to build an iOS app built using Ionic / Cordova on Azure DevOps
Getting this error:
Using cordova-fetch for cordova-ios#^5.0.0
Failed to fetch platform cordova-ios#^5.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: Cannot find module 'UNMET/package.json' from '/Users/vsts/agent/2.148.2/work/1/s'
[ERROR] An error occurred while running subprocess cordova.
I am using a simple setup using the following steps:
Agent: Hosted macOs
npm install
Ionic Command [ionic version: 4.12.0; Cordova Version: default]
Publish Build Artifacts

We had the same problem, and the solution was to make sure all NPM dependencies were met.
Check the logs for the npm install step and see if there are any unmet dependencies there and add/update missing depedencies in your package.json file.

Related

Codemagic build process for a Flutter app: Could not find a file named "pubspec.yaml"

I am using Codemagic for the iOS build process for a Flutter app.
In the pubspec.yaml I am referring to a package dependency by pointing to a public repository like so:
dependencies:
flutter:
sdk: flutter
flutter_circular_slider:
git: https://github.com/tomoehlrich/flutter-circular-slider.git
It all works with local debugging and when building an apk with "flutter build apk" on Windows.
Codemagic though keeps giving me the following error message in the build step "Installing dependencies":
== Install Flutter dependencies ==
> flutter packages pub get
Resolving dependencies...
Could not find a file named "pubspec.yaml" in https://github.com/tomoehlrich/flutter-circular-slider.git 5d6d0c54e93766b27d30707bf20042b26894561c.pub
finished with exit code 1
Build failed :|Failed to install dependencies
I had Codemagic working before. The difference now to the working version was that I was referencing a different repository on Github.
I am trying to figure out why the build process cannot find the pubspec.yaml in https://github.com/tomoehlrich/flutter-circular-slider.git but in another fork of the same flutter package on Github.
Any hints are highly appreciated.
It seems that "resolved-ref" in pubspec.lock for the slider package was an outdated reference.
A new generation of pubspec.lock, sync to GitHub and start a new build process in Codemagic did the trick.

Siri implementation in IONIC- Cli 5.4.13 Native

When i install Cordova Plugin cli command some exception get error display in below
Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
[ERROR] An error occurred while running subprocess cordova.
How to implementation IONIC Native -Siri
This error sometimes implies that the plugin is not compatible with your project's cordova version. Try downgrading to Cordova 8, I think ionic 5 application comes loaded with Cordova 9. Add cordova dev dependancy as
npm install cordova#8.0.0 --save-dev

How to fix cocoa pods flutter bug?

I am trying to run several dependencies on my flutter project however end up always getting the same error while running the project on ios and the full terminal message looks like this:
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/username/Desktop/flutter_test/xylophone/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'assets_audio_player/AssetsAudioPlayerPlugin.h' file not found
#import <assets_audio_player/AssetsAudioPlayerPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone X.
Launching lib/main.dart on iPhone X in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.dev/platform-plugins
To install:
brew install cocoapods
pod setup
Xcode build done. 5.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Exited (sigterm)
This occurs with every dependency that I try to use from the flutter packages and I really don't know how to fix this. The process of installing cocoapods also doesn't work.
This has an existing GitHub issue. The error you've encountered was because the time you've installed cocoapods, it was installed with different version of ruby than you currently have active.
The recommended way to fix this is to to uninstall your existing cocoapods brew uninstall cocoapods and install a fresh one, via sudo gem install cocoapods.

Ionic 3 shows error 400 while adding platforms

I am trying to migrate from one system to another. Thus have cloned the code from my git repository on my system and now am trying to deploy an application from my new system. So as am trying to add platforms for the same thus I have executed the npm install command successfully and now when I try to run the ionic cordova platform add ios but the command ends up with an error with error code 400 exact error is as follows :
> cordova platform add ios --save
✔ Running command - done!
> ionic cordova resources ios --force
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations - done!
✖ Generating platform resources - failed!
Error: encountered bad status code (400) for https://res.ionic.io/api/v1/transform
body: {"Error":"source image 1015x1015 too small for Default-736h.png, requires at least 1242x2208 source file"}
at Response.res.on (/My Drive/ionic_app/node_modules/#ionic/cli-utils/lib/cordova/resources.js:148:32)
at emitNone (events.js:106:13)
at Response.emit (events.js:208:7)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
I tried replacing the images but the issue is persistent. Unable to figure out the issue.My current operating system is macOS High Sierra. However the code works fine when executed in ionic lab environment using ionic serve -l
If you execute ionic cordova resources --help you'll notice that the output says something like:
[...] The source image for splash screens should ideally be at least
2732×2732px and located at resources/splash.png [...]
So in order to fix it you'd need to replace the splash.png file (in the resources folder) by a new splash image of 2732×2732px.
Then run ionic cordova resources again and it should be fixed.

The platform "ios" does not appear to be a valid cordova platform

I'm running under cordova#7.1.0, cordova-ios#4.5.2.
Installed platforms: ios 4.5.2.
I run npm install, bower install then cordova prepare ios and i get the following error:
Unable to load PlatformApi from platform. Error: Cannot find module 'unorm'
Error: Unhandled "error" event. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
The solution is to cordova platform rm ios and cordova platform add ios. But i have to do this each time i checkout my project from git ...
Do you have any suggestion to solve this issue?
Many thanks !
You should not put the platforms (and plugins) folder into source-control. Reinstalling the platform after a fresh checkout is the expected behaviour.
The files in the platforms folder are created dynamically which is why they should not be in source control.

Resources