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

iOS build is failing #82

Closed
HarelM opened this issue Dec 31, 2019 · 9 comments
Closed

iOS build is failing #82

HarelM opened this issue Dec 31, 2019 · 9 comments

Comments

@HarelM
Copy link
Contributor

HarelM commented Dec 31, 2019

Hi,
Thanks for this great extension! It's working great on my android app.
I'm trying to add this extension to iOS and when adding it the build is failing... :-/
Failure can be seen here:
https://ci.appveyor.com/project/IsraelHikingHost/site/builds/29826306/job/1utb7xvtubx1c2xr

OpenWithPlugin.m:2:9: fatal error: 'ShareViewController.h' file not found
#import "ShareViewController.h"
        ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

The code can be seen here:
https://github.com/IsraelHikingMap/Site/tree/master/IsraelHiking.Web
When removing this plugin the build passes (locally, I haven't tried it yet on the build server).

Some side questions:

  1. Can this be done entirely from CI without opening xcode (I saw the video and there was manual work xcode UI which I hope is not necessary, otherwise I won't be able to automate my build process)?
  2. Did I configure something wrong in my project.json file as I see the following line in the build:
Adding team null and provisoning profile null
Added ShareExtension to XCode project
@NiklasMerz
Copy link
Collaborator

Did you provide the iOS settings via variables?

cordova plugin add cc.fovea.cordova.openwith \
  --variable ANDROID_MIME_TYPE="image/*" \
  --variable IOS_URL_SCHEME=ccfoveaopenwithdemo \
  --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.image
  --variable SHAREEXT_PROVISIONING_PROFILE="xxxxxxxxxxxxxxxxxxxxx"
  --varibale SHAREEXT_DEVELOPMENT_TEAM="My Team"

Unfortunately this stuff is hard to automate. You might need to fix some scripts or go through Xcode. I am open to any PR.

@HarelM
Copy link
Contributor Author

HarelM commented Dec 31, 2019

I'll check, I have manually added the configuration to package.json so that might be it. See #83 as to why I thought it would work.

@NiklasMerz
Copy link
Collaborator

Yes this plugin has hook scripts that get the values from config.xml only for now.

@HarelM
Copy link
Contributor Author

HarelM commented Dec 31, 2019

@NiklasMerz I have added the relevant flags and it seems that the project is using them but I still get the same error.
Any chance you can download the project and try to compile it as well to see that this issue is reproducible? I think I experienced it on my mac as well...
See here:
https://ci.appveyor.com/project/IsraelHikingHost/site/builds/29829050/job/187bq7xo5pd3uy7l
Same error:

OpenWithPlugin.m:2:9: fatal error: 'ShareViewController.h' file not found
#import "ShareViewController.h"
        ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@HarelM
Copy link
Contributor Author

HarelM commented Dec 31, 2019

Interestingly, when adding the package using cordova plugin add ... I get different results from the build server as I see different console logging which I expect to see on my build machine like this line:

console.log('Copying "' + PLUGIN_ID + '/ShareExtension" to ios...');

Might be something to do with how cordova works, I have no clue...
In any case, after manually adding the plugin on my developer machine I got another error saying:
"No signing certificate "iOS Development" found...
I probably need another provisioning file for the extension project, I'm not sure, but it seems to be too complicated to continue right now.
I'll stabilize my build process without this extension and see if I can come back to it once it is stable.

@NiklasMerz
Copy link
Collaborator

Yes this whole iOS signing is difficult for extensions. I am using a separate profile for extensions.

@HarelM
Copy link
Contributor Author

HarelM commented May 15, 2020

@BenjaminPoncet are you using this plugin with a CI server and was able to make it work without opening xcode?
I've seen this branch:
https://github.com/missive/cordova-plugin-openwith/
Which sounded good, but still doesn't fully work in with CI...

@HarelM
Copy link
Contributor Author

HarelM commented Jul 23, 2020

Hopefully the above PR should fix this issue.

@HarelM
Copy link
Contributor Author

HarelM commented Aug 6, 2020

As a side note, I managed to make my CI build pass after using the above PR and another PR for cordova-ios to fix the issue with the provisioning profiles.
apache/cordova-ios#956
I hope both get merged so that other people will be able to build ipa files using this plugin in a CI environment.

@j3k0 j3k0 closed this as completed in d6a2bf2 Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants