cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

XCode cannot build : Cordova.h and Info.plist missing files

Open mushu8 opened this issue 5 years ago • 22 comments

Bug Report

Problem

I cannot build my XCode project generated by Cordova :

CordovaLib.xcodeproj/Cordova/Cordova.h and CordovaLib.xcodeproj/Cordova/Info.plist files are not generated thus an error is thrown during XCode compilation.

What is expected to happen?

I can build and run my project.

What does actually happen?

Information

I tried to get these files from the cordova-ios repository and add them (and link) manually in the XCode project but others errors are thrown by the compiler

Command or Code

these commands don't show any errors and very few warning (ld file or directory not found for -F… due to the cordova-plugin-firebasex plugin) :

  • ionic cordova platofrm add ios --no-resources
  • ionic cordova build ios --debug --buildConfig=./resources/ios/build.json --source-map

Environment, Platform, Device

Mac OS X Mojave 10.14.5 (18F132) iOS 12.0

Version information

Ionic: Ionic CLI : 5.4.13 (~/.nvm/versions/node/v10.14.1/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.11.7 @angular-devkit/build-angular : 0.801.3 @angular-devkit/schematics : 8.1.3 @angular/cli : 8.1.3 @ionic/angular-toolkit : 2.0.0

Cordova: Cordova CLI : 9.0.0 ([email protected]) Cordova Platforms : ios 5.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 9 other plugins)

Utility: cordova-res : 0.8.1 native-run : 0.3.0

System: Android SDK Tools : 26.1.1 (~/Library/Android/sdk) ios-deploy : 1.10.0 ios-sim : 8.0.2 NodeJS : v10.14.1 (~/.nvm/versions/node/v10.14.1/bin/node) npm : 6.13.1 OS : macOS Mojave Xcode : Xcode 11.2.1 Build version 11B500

Checklist

  • [X] I searched for existing GitHub issues
  • [X] I updated all Cordova tooling to most recent version
  • [X] I included all the necessary information above

mushu8 avatar Jan 03 '20 13:01 mushu8

I just added the help wanted label. It would be extremely helpful for us if you could give us the minimal, reproducible example ([1]) with no use of Ionic. Also this looks like a custom build procedure which we do not have the extra resources to support.

How to embed in an existing application was already documented. I am not sure if anyone has tested this in the past few years.

[1] https://stackoverflow.com/help/minimal-reproducible-example

brody4hire avatar Feb 18 '20 19:02 brody4hire

I have the same error image

fwgood avatar May 12 '20 03:05 fwgood

I am also getting the same error trying to build from the xcode app Screen Shot 2020-05-15 at 5 18 22 PM

A little background. I just recently upgraded to 10.15.4 catalina and am thinking this may be a cause but can't verify that.

feniquill avatar May 15 '20 23:05 feniquill

I get the same error.

Captura de Tela 2020-06-17 às 17 05 02

lucianotrevisanalberti avatar Jun 17 '20 20:06 lucianotrevisanalberti

@lucianotrevisanalberti it looks like your Xcode GUI is trying to just build the Cordova subproject, which is not really tested or supported by us. Please click on this control and use it to select your application build project:

Screen Shot 2020-06-17 at 4 44 20 PM

I suspect that this would affect other users. I think this should be documented as a pitfall.

brody4hire avatar Jun 17 '20 20:06 brody4hire

guys, the problem was fixed deleting "ios" folder (inside of "platform" folder) and running "build" again... Build Success

thanks @brodybits , but in older versions "Generic iOS Device" works

lucianotrevisanalberti avatar Jun 17 '20 20:06 lucianotrevisanalberti

same issue i faced now, already did above mentioned things. Not working that, any solutions ? @brodybits @lucianotrevisanalberti @feniquill @mushu8

Rahulbhutani97 avatar Dec 27 '20 17:12 Rahulbhutani97

@Rahulbhutani97 it looks like there is something wrong with your project or installation. I would highly recommend you check that you have all tools updated and start with a new workarea, no plugins or platforms folders. For further support please give us the information requested in the template. Thanks.

I have raised https://github.com/apache/cordova-docs/issues/1143 to get the pitfall documented.

brody4hire avatar Dec 28 '20 14:12 brody4hire

@brodybits thanks i update my screenshot there for reference at https://github.com/apache/cordova-docs/issues/1143

Rahulbhutani97 avatar Dec 28 '20 17:12 Rahulbhutani97

Screenshot 2020-12-28 at 10 54 08 PM

Build succeded :: in VScode

Screenshot 2020-12-28 at 10 56 03 PM

When i open .xcodeProj file then run build it shows error of info.plist

The screenshot should have been here, https://github.com/apache/cordova-docs/issues/1143 is just to get the pitfall documented for others.

I personally find it easiest to just open the project in platforms/ios in Xcode and build from there.

brody4hire avatar Dec 28 '20 18:12 brody4hire

What I mistaken?? .xcodeproj open in xcode or just open platform/ios folder in xcode?

Rahulbhutani97 avatar Dec 28 '20 18:12 Rahulbhutani97

You should open the .xcodeproj in Xcode (it is in platofrms/ios) then build and run.

brody4hire avatar Jan 03 '21 00:01 brody4hire

Already did

On Sun, 3 Jan, 2021, 5:39 am Chris Brody, [email protected] wrote:

You should open the .xcodeproj in Xcode (it is in platofrms/ios) then build and run.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/cordova-ios/issues/760#issuecomment-753546758, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOP2B6NDY6GV4WODHGQD4DSX6YVJANCNFSM4KCNXJJA .

Rahulbhutani97 avatar Jan 03 '21 03:01 Rahulbhutani97

Issue resolved... yeah :)

Rahulbhutani97 avatar Jan 04 '21 17:01 Rahulbhutani97

@Rahulbhutani97 how did you solved it?

andresloopear avatar Jan 11 '21 18:01 andresloopear

signin with your team (i.e. apple account) then in xcode under Product > Archive then you will get Build succeeded or failed https://blog.rahulbhutani.com/ connect me here if you want

Rahulbhutani97 avatar Jan 11 '21 18:01 Rahulbhutani97

I managed to fix this by selecting my application build project. It seems that by default, the Cordova subproject is selected in Xcode GUI.

image

If you have something like in this picture, the wrong build project is selected. Just click on Cordova and select your project from there.

I think this is the correct answer for this issue.

radu2323 avatar May 12 '21 07:05 radu2323

I just ran into this today with an existing Ionic project that worked fine. I am on Big Sur (11.4) and running Xcode 12.5.1, Ionic 6.13.1 and Cordova 10.0.0.

I have removed the iOS platform and the added again. I get a successful build with Ionic/Cordova, but when I open in Xcode and try to build the project it is giving a build error and indicates the Cordova folder, Info.plist & Cordova.h are missing from CordovaLib.xcodeproj.

I have tried set the device to "Any iOS Device" as well as specific platforms, all with the same result. The error seems to be more related to the Cordova build process.

Any suggestions?

rmeske avatar Jul 20 '21 15:07 rmeske

Hy

Add info.plist file and cordova.h

And check info.plist was there ??? Actually it is default to be there

On Tue, 20 Jul 2021 at 8:55 PM, Ron Meske @.***> wrote:

I just ran into this today with an existing Ionic project that worked fine. I am on Big Sur (11.4) and running Xcode 12.5.1, Ionic 6.13.1 and Cordova 10.0.0.

I have removed the iOS platform and the added again. I get a successful build with Ionic/Cordova, but when I open in Xcode and try to build the project it is giving a build error and indicates the Cordova folder, Info.plist & Cordova.h are missing from CordovaLib.xcodeproj.

I have tried set the device to "Any iOS Device" as well as specific platforms, all with the same result. The error seems to be more related to the Cordova build process.

Any suggestions?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/cordova-ios/issues/760#issuecomment-883483629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOP2BZHNJ5DZR6BEII6NBLTYWIOXANCNFSM4KCNXJJA .

Rahulbhutani97 avatar Jul 20 '21 16:07 Rahulbhutani97

I reopened the project to add the files and and noticed it was giving a conflict on the signing. So first, I unchecked the "Automatically manage signing" and then rechecked it and added the Team back. It now builds successfully.

The two files are missing but Xcode successfully builds and the app runs properly.

rmeske avatar Jul 20 '21 23:07 rmeske

Greatt

If any work you have for me like any paid task i am available to you

Shall we connect further ??

On Wed, 21 Jul 2021 at 4:47 AM, Ron Meske @.***> wrote:

I reopened the project to add the files and and noticed it was giving a conflict on the signing. So first, I unchecked the "Automatically manage signing" and then rechecked it and added the Team back. It now builds successfully.

The two files are missing but Xcode successfully builds and the app runs properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/cordova-ios/issues/760#issuecomment-883767173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOP2B6DYSE4WBFORPAQLQ3TYX72BANCNFSM4KCNXJJA .

Rahulbhutani97 avatar Jul 21 '21 01:07 Rahulbhutani97

No se si aya se encontró la solución, en mi caso era porque estaba abriendo el archivo de .xcodeproj, lo cual no cargaba correctamente el proyecto, opte por cargar el archivo .xcworkspace y cargó a la perfección.

andres199556 avatar Sep 30 '21 15:09 andres199556

I intermittently get this error in the form of missing Info.plist in the CordovaLib scheme. Selecting the app scheme in XCode does not seem to fix the error. Sometimes the file is generated when running prepare and build, and sometimes it isn't.

chr15m avatar Jan 13 '23 02:01 chr15m

已收到您的邮件,会尽快回复

fwgood avatar Jan 13 '23 02:01 fwgood

I believe this can happen if you open the project's .xcodeproj file rather than the project's .xcworkspace file.

dpogue avatar Jan 13 '23 02:01 dpogue

@dpogue thank you that seems to have fixed the issue so far. Will post here if it happens again.

chr15m avatar Jan 13 '23 02:01 chr15m

@dpogue it works perfectly 👍🏾 thank you

Mady-Camara avatar Jan 18 '23 07:01 Mady-Camara

It seems like opening the project's .xcworkspace works, so I'm going to close this issue.

dpogue avatar Apr 16 '23 01:04 dpogue