I cannot create add ios platform for onesignal plugin. With android build its fine.
I did this:
$ ionic cordova platform add ios
the following errors failed.
apple-ios version check failed ("/Users/megasap/Documents/project/railerdotcom/railercom_parent/platforms/ios/cordova/apple_ios_version"), continuing anyways.
Failed to install 'onesignal-cordova-plugin': undefined
Failed to restore plugin "onesignal-cordova-plugin" from config.xml. You might need to try adding it again. Error: /Users/megasap/.rbenv/shims/pod: line 21: /usr/local/Cellar/rbenv/1.0.0/libexec/rbenv: No such file or directory
--save flag or autosave detected
Saving ios#~4.5.4 into config.xml file ...
[ERROR] Exception:
Full execution and error here:
https://gist.github.com/axilaris/a926c54eb515bef5eb2f7019e36aa40f
This used to work, i just update to latest xcode 9.2 to compile other things. Is it something wrong with using the latest xcode ?
install and update cocoapods fix the problem
sudo gem install cocoapods
pod setup
You may need to rm and add ios platform to make it work
The actual issue is here:
Error: /Users/megasap/.rbenv/shims/pod: line 21: /usr/local/Cellar/rbenv/1.0.0/libexec/rbenv: No such file or directory
Just update/install cocoapods to latest version as your xcode is also updated.
sudo gem install cocoapods
Related
I'm trying to run the command
ionic cordova platform add ios#6.2.0
everything is updated, my versions are:
ionic - 6.17.1
npm - 7.21.1
node - 16.9.1
pod - 1.11.2
I have the last version of Xcode (13) just released 2 days ago. When running that command I get:
--save flag or autosave detected
Saving ios#~6.2.0 into config.xml file ...
Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to: "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h" for build configuration Debug
Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to: "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h" for build configuration Release
Update IOS build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to: YES for build configuration Debug
Use Swift language version 5
Update IOS build setting SWIFT_OPTIMIZATION_LEVEL to: -Onone for build configuration Debug
Update IOS build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to: YES for build configuration Release
Use Swift language version 5
[ERROR] An error occurred while running subprocess cordova.
cordova platform add ios#6.2.0 exited with exit code 1.
After reading every post I found, I included on my config.xml:
<preference name="UseSwiftLanguageVersion" value="5" />
Thinking I might had a non-supported Xcode version, I downgraded Xcode to v12.5.1, selected it on Xcode -> Preferences -> Locations, then restarted all terminals and processes, restarted the Mac, but still not working.
I tried to update CocoaPods with the commands:
pod install
pod setup
And still nothing was working so I decided to run the command
ionic cordova prepare ios
to see if I could go on anyway but got this error:
[error] Error: Cannot find module '#ionic/angular-toolkit/package.json'
Require stack:
- /usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/architect/node/node-modules-architect-host.js
- /usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/architect/node/index.js
- /usr/local/lib/node_modules/#angular/cli/models/architect-command.js
- /usr/local/lib/node_modules/#angular/cli/commands/run-impl.js
- /usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/tools/export-ref.js
- /usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/#angular/cli/utilities/json-schema.js
- /usr/local/lib/node_modules/#angular/cli/models/command-runner.js
- /usr/local/lib/node_modules/#angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/#angular/cli/lib/init.js
- /usr/local/lib/node_modules/#angular/cli/bin/ng
And yes, if you are wondering every time I updated or ran a command I did also deleted the platforms, plugins, node_modules and www folder, but anything is happening.
Coincidentally today I had to migrate a Cordova project to iOS 6.2 due to Apple's usual annoyance in updating hours before and leaving everything obsolete (the best in backward compatibility, it should be noted).
I'll share with you the short commands that work with cordova without digging too much:
0-) sudo npm install cordova-ios#latest
1-) sudo ionic cordova platform remove ios
2-) sudo ionic cordova platform add ios#latest // don't specify version, the last one already assumes this
3-) sudo chmod -R 777 platforms/ios // usually, I must enable read and write permissions, things on my computer but with that I ensure full permission.
4-) sudo ionic cordova build ios
5-) You open XCode again in the generated project and voila, you can compile it.
If step #1 fails you, run it 2 times (for some reason I always have to run it 2 times to get it done).
Best regards.
Well, at the end, after 15h of work and a lot of searching, it was all fixed by downgrading my Node version from 16.9.1 to 14.17.5.
I didn't know that this new Node version is not supported by Angular jet, but I found out, and you can too by just running the command
ng -v
which says at the end
Warning: The current version of Node (16.9.1) is not supported by Angular.
to downgrade your Node version you can follow the instructions on this post:
How to downgrade Node version
You can also see all the Node versions available here:
https://nodejs.org/es/about/releases/
Since Angular is a step behind of Node I suggest to download an Active version and not a current one.
We make middleware using Cordova and AdMob to show ads. Cordova generates an Xcode project for us. However the resulting Xcode projects now fail to build with the error ld: framework not found UserMessagingPlatform.xcframework.
This appears to be caused by the Google UMP SDK updating to version 1.3.0, which notes "Updated the SDK from a .framework to a .xcframework." I've contacted AdMob support, and they claim the build works for them and haven't provided any useful help.
I have no idea why our builds now fail and I'm at a loss as to what to do about it. Here is a sample Xcode project: https://www.dropbox.com/s/y1ly2c3yi45rop6/TestBuild.ios.project.zip?dl=0
Can anyone identify what has gone wrong with this Xcode project causing it to fail to build, and identify a workaround?
The Issue
The issue appears to be that a framework/dependency is not added to the Xcode project, so it doesn't have the code necessary to compile the application. AdMob relies on that UserMessagingPlatform thing to work, and without the Mobile Ads SDK being present in your codebase, UserMessagingPlatform is missing and your application is essentially asking for code that isn't there. To resolve this, you have to tell cocoapods (a dependency manager, think npm but for Swift/Objective-C) to locate and add the missing code to your project.
First, install cocoapods if you haven't already. I used Homebrew to do this, as it seems to be the only method that worked without headache. Many people already have Homebrew, but if you don't, install that first, then run:
brew install cocoapods
Next, go into your project directory using the Terminal. Once you're in the directory, run:
pod install --repo-update
Reopen your project in Xcode, and it should compile successfully now.
Step by step resolution:
Skip any steps that aren't necessary for your environment.
Install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install cocoapods: brew install cocoapods
Open a terminal, navigate to your project directory: cd /path/to/your/project
Update dependencies: pod install --repo-update
Disclaimer: I'm not a Swift or Objective-C developer, and my experience with Apple/Xcode is limited. I also am unfamiliar with "cocoapods" and AdMob. I just downloaded the sample code and worked through the issue until I got it to compile successfully.
Are you using Cocoapods for your XCode project?
This stackoverflow answer suggest updating cocoapods
Try updating cocoapods:
sudo gem install cocoapods
Cocoapods changelog contains fixes for XCFrameworks
.xcframework files can only be used on CocoaPods 1.10.0 or newer, in your sample app you were using 1.8.4.
Update CocoaPods to latest and run pod install again.
I am using Ionic with the google Plus cordova plugin: https://ionicframework.com/docs/v3/native/google-plus/
I set up everything correctly and it works without any problems on Android.
On iOS I used the command "Ionic cordova prepare iOS", at first I got problems with some Cocoapods ("cannot run cocoapods as root"), I fixed that Error with the help of this post: Can't run sudo pod install after updating to cocoapods 0.32.1 with error "You cannot run CocoaPods as root. (CLAide::Help)". After that I was able to get a .xcodeproj.
After some research I found out I have to open the .xcworkspace.
I clicked on run and got the Error: "GoogleSignIn/GoogleSignIn.h" file not found
Uninstall plugin : cordova plugin rm cordova-plugin-googleplus
Install plugin version 7.0.1: cordova plugin add cordova-plugin-googleplus#7.0.1
This will fix your problem reason being version 7.0.1 doesn't use POD dependencies.
Solution: downgrade cordova-plugin-googleplus to version 7.0.2
If you are using Firebase make sure that your podfile is not written GoogleUtilities, if so delete it, and leave only GooglePlus. Then give
pod install
to the root of your project and that's it.
Accepted the answer from ch3t. However on installing you need to supply the app specific variables as seen below. For reference visit the link https://github.com/EddyVerbruggen/cordova-plugin-googleplus/blob/master/README.md#4-installation-phonegap-cli--cordova-cli
cordova plugin add cordova-plugin-googleplus#7.0.2 --save --variable REVERSED_CLIENT_ID=myreversedclientid --variable WEB_APPLICATION_CLIENT_ID=mywebapplicationclientid
I had encountered with the same problem and solved it by this:
Copy ios/RNGoogleSignin into Libraries folder in Xcode
Add this line to Framework Search Paths in Build Settings:
$(PROJECT_DIR)/GoogleSDK
Remove libRNGoogleSign.a from Link Binary With Libraries in Build
Phases:
And lastly clean your build folder and build.
Credits to: taingmeng
I used an old mac, that was the problem
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.
I'm trying to build an Ionic 2 app with push notification in iOS.
I added Phonegap plugin push notification with this command line :
cordova plugin add phonegap-plugin-push --variable SENDER_ID=12341234 --save
But when I try to run my project in a device I have this error in xcode :
"GoogleCloudMessaging.h" file not found
I looked for a solution and I had install Cocoapods. I removed platform iOS and I try to add it with this command line :
sudo ionic platform add ios
I had this error :
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push':undefined
Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ env Display pod environment
+ init Generate a Podfile for the current directory
+ install Install project dependencies according to versions from a
Podfile.lock
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:47:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
I tried to run "pod install" directly in platforms/ios folder, but same issue.
So I try to remove sudo in the commande :
ionic platform add ios
But obviously I have this error :
MacBook-Air-de-user:MyApp compagny$ ionic platform add ios
Error during untar for /Users/user/.cordova/lib/npm_cache/cordova-ios/4.3.1/package.tgz: Error: EACCES: permission denied, open '/Users/user/.cordova/lib/npm_cache/cordova-ios/4.3.1/package/package.json'
Error: Failed to fetch platform ios
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EACCES: permission denied, open '/Users/user/.cordova/lib/npm_cache/cordova-ios/4.3.1/package/package.json'
I really don't know what I have to do to solve that. An Idea ?
Try update Cordova version, remove platforms and add again:
npm install -g cordova
cordova platform remove android
cordova platform remove ios
cordova platform add android
cordova platform add ios
cordova plugin add phonegap-plugin-push --save
I had the same problem and its worked for me.
If anyone is still having issues, I got it to work by running
pod install
in platforms/ios
and you may need to add permissions in that folder before that
sudo chown -R *username* platforms/ios
To allow code executions on your mac without using sudo simply run.
sudo chown -R Username /Users/username/Document/project location
It's working for me
If you use any plugin and platform add please install and add without
"sudo".
If needed permission them go to the project directory and click
setting->Get Info to give "Read & Write" permission then you can install plugin and platform without "sudo"
ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated#7.5.0
ionic cordova build ios --prod