Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podfile multiple targets generated if single quote is used in app name #717

Closed
3 tasks done
mikealo opened this issue Nov 11, 2019 · 6 comments · Fixed by #1485
Closed
3 tasks done

Podfile multiple targets generated if single quote is used in app name #717

mikealo opened this issue Nov 11, 2019 · 6 comments · Fixed by #1485
Milestone

Comments

@mikealo
Copy link

mikealo commented Nov 11, 2019

Bug Report

Podfile multiple targets generated if single quote is used in app name, this issue is not created if app does not contain single quote

Problem

If a single quote is used in the app name for example "Test's single quote" and there is any additional plugin that use any pod library then the podfile generated contains multiple targets and cordova fail the plugin installation

What is expected to happen?

The podfile generated should look like this:

platform :ios, '9.0'
target 'Test\'s single quote' do
	project 'Test\'s single quote.xcodeproj'
	pod 'GoogleMaps', '~> 2.0.0'
end

What does actually happen?

The podfile generated look like this:

platform :ios, '9.0'
target 'Test\'s single quote' do
	project 'Test\'s single quote.xcodeproj'
end
target 'Test\'s single quote' do
	project 'Test\'s single quote.xcodeproj'
	pod 'GoogleMaps', '~> 2.0.0'
end

Information

Command or Code

cordova create "Test's single quote" com.test.singlequote "Test's single quote"
cordova platform add ios
cordova plugin add cordova-plugin-googlemaps

Environment, Platform, Device

Version information

MacOS 10.15
Xcode 11.2
Node v12.5.0
Ruby Gem 3.0.6
CocoaPods 1.8.4
Cordova 9.0.0 ([email protected])
Cordova iOS platform 5.0.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@mibzman
Copy link

mibzman commented Dec 17, 2019

I'm having this issue as well. @mikealo, did you discover a workaround?

@mikealo
Copy link
Author

mikealo commented Dec 18, 2019

@mibzman unfortunatly i ended app changing app name and removing single quote.

Even if you change the podfile generated in the project>platform>ios folder manually you can then create errors during build process so i avoided doing so.

The file on ios platform that generate the podfile should be this one:

https://github.com/apache/cordova-ios/blob/master/bin/templates/scripts/cordova/lib/Podfile.js

@mibzman
Copy link

mibzman commented Dec 18, 2019

Thanks for the response. I've also ended up changing my app name. I removed the single quote from the name property and went with a combination of this plugin and this config to change the display name back to a name with the single quote.

Hopefully, the core team can get to fixing this soon.

@RobWouters
Copy link

I have not confirmed this but I suspect the culprit is this regex:

const declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do');

@csi-slizhevskyv
Copy link

the same issue. UP!

@dpogue
Copy link
Member

dpogue commented Sep 26, 2024

Just noting that even if this Podfile issue is resolved in Cordova (which it hopefully will be soon), there are other issues in Cocoapods regarding project names with single quotes: CocoaPods/CocoaPods#7546

@dpogue dpogue added this to the 8.0.0 milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants