Coder Social home page Coder Social logo

Comments (6)

codinronan avatar codinronan commented on July 28, 2024 7

@knight9999 damn... after 2 days of hunting the specific issue here is the bug in all its glory. Ran into this as well, actually ran through the entire alphabet to realize that any letter after 'P' was a problem and was totally stumped why that would be the case but I did realize that it had something to do with CocoaPods.

Ok so now that knight has done all the hard work of figuring out why it happens here's the solution:

diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
index be8f78e..20340fe 100644
--- a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
+++ b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js 
@@ -175,7 +175,7 @@ function resolveConfigFilePath (project_dir, platform, file) {
 
         // [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
         if (matches.length > 1 && file.includes('-Info.plist')) {
-            var plistName = getIOSProjectname(project_dir) + '-Info.plist';
+            var plistName = '/' + getIOSProjectname(project_dir) + '-Info.plist';
             for (var i = 0; i < matches.length; i++) {
                 if (matches[i].includes(plistName)) {
                     filepath = matches[i];

Just throw that change into patch-package and you are golden (make sure to get your local project node-modules AND the global npm node-modules). This change ensures that the only matching filename MUST begin with the forward slash (which excludes any Pods path) without accidentally excluding app names that might start with the word "Pods".

I'd open a PR for this but... I've actually spent 5 days hunting this down (it started when I realized none of the plugins had any of their variables). Time to catch up on lost time.

from cordova-common.

dpogue avatar dpogue commented on July 28, 2024 1

One thing worth noting is that in newly-created Xcode projects, the plist filename is just Info.plist without the app name prefix. Unfortunately we can't rename ours to match without breaking every plugin.xml or config.xml that tries to edit it 😕

from cordova-common.

Armanio avatar Armanio commented on July 28, 2024 1

@codinronan, @knight9999 thx for yours effort. 🥇

from cordova-common.

knight9999 avatar knight9999 commented on July 28, 2024

Thanks @dpogue .
You are right. I have just confirmed it by creating a new project by Xcode 10.3 with using a default ios Single View App template. The created file name is Info.plist.

If we can't rename ours [App Name]-Info.plist filename in cordova-ios,
I think we'd better update the logic to find *-Info.plist in ConfigFile.js.

from cordova-common.

edwinofsakh avatar edwinofsakh commented on July 28, 2024

I have a same problem. Is there a solution without changing the name of the application?

from cordova-common.

knight9999 avatar knight9999 commented on July 28, 2024

@codinronan Thanks for the great work. Please open your PR!

from cordova-common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.