ibm-bluemix-mobile-services / bms-clientsdk-cordova-plugin-push

Cordova Push notifications Plugin for IBM Cloud Mobile Services
Apache License 2.0
9 stars 9 forks source link

ARCHIVE FAILED - Code Signing Error: BMSAnalyticsAPI - Xcode 9 #90

Open GlenMasters opened 6 years ago

GlenMasters commented 6 years ago

I get the following error whilst executing cordova build ios:

Code Signing Error: The file "/XXX/platforms/ios/Pods/Pods/Entitlements-Debug.plist" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "BMSAnalyticsAPI" and build configuration "Debug" is correct and that the file exists on disk.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

** ARCHIVE FAILED **

If I open the created workspace in Xcode a dialog opens with the following message:

"Unsupported Swift Version" The project "Pods" contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift2.x targets.

Use Xcode 8.x to migrate the code to Swift 3.

AnanthaKrish commented 6 years ago

@GlenMasters you dont have to do the migration part. We have done it already .

Do the following to fix the issue,

  1. open Xcode 9, and go to Xcode->preferences->Locations . Change the Command Line tools to Xcode 9.* (If its not there please download it from here https://developer.apple.com/download/more/ )

  2. Now go the project and go Targets->BuildSettings

  3. Add your signing credentials and certificates

  4. Go to capabilities and enable Push Notifications and BackGround Modes -> Remote notification

  5. go to the Pods project (In navigator area) and go to the BMSAnalyticsAPI

  6. Go to the build Settings and add the swift version (Do the same for BMSPush And BMSCore also)

No build the project in Xocde .

To configure the signing credentials automatically follow this - https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push#adding-auto-signing-in-ios

GlenMasters commented 6 years ago

Hi @AnanthaKrish

I have followed this process and can get a successful build and deploy from within the Xcode environment.

However I still experience an ARCHIVE FAILED error when using the cordova build tools. e.g.

cordova build ios --buildConfig 

The error is:

=== BUILD TARGET BMSAnalyticsAPI OF PROJECT Pods WITH CONFIGURATION Debug ===

Check dependencies
Code Signing Error: The file "/Users/glenmasters/Documents/workspace/Celadin-Lime2/platforms/ios/Pods/Pods/Entitlements-Debug.plist" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "BMSAnalyticsAPI" and build configuration "Debug" is correct and that the file exists on disk.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
AnanthaKrish commented 6 years ago

@GlenMasters Hi,

  1. Your signing credentials are not there it seems. please add them properly
  2. Open the project in Xcode. Go to the pods section. set the Swift version which is compatible for your project.

While doing the archive try to do it from Xcode itself. So that you will come to know where are the issues correctly.

GlenMasters commented 6 years ago

@AnanthaKrish

As I said - I have followed your instructions - and it DOES build in Xcode.

My issue is that it does not build at the command line.

AnanthaKrish commented 6 years ago

@GlenMasters Hi, disable the code signing in pod files try. Before that please check which command line you are using. Go to Xcode->preferences->Locations and change the Command Line tools to Xcode 9.2

GlenMasters commented 6 years ago

@AnanthaKrish Hi, My command Line tools are: XCode 9.2 (9c40b) - which looks correct. I am not sure what you mean by "disable the code signing in pod files" Is this something I'd do from within XCode?

AnanthaKrish commented 6 years ago

@GlenMasters Yes. I think its doing a code signing for the pod files.

GlenMasters commented 6 years ago

@AnanthaKrish

This is how my project looks by default - before I change anything. What should I do next?

xcode
AnanthaKrish commented 6 years ago

@GlenMasters Check the build settings -> signing of each pod. And disable code signing there

GlenMasters commented 6 years ago

@AnanthaKrish

Do you mean this screen? If so what do I change?

xcode2
AnanthaKrish commented 6 years ago

@GlenMasters That looks fine. Did you change the bundle id in config.xml ?

GlenMasters commented 6 years ago

@AnanthaKrish

If by bundle id you mean the value here, then yes.

<widget android-versionCode="109026" id="com.celadin.gtt2018" ios-CFBundleVersion="1.9.26" version="1.9.26" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
AnanthaKrish commented 6 years ago

@GlenMasters Hi, looks like this is an apache cordoca issue.

i have a work around for you.

After adding the push Plugin,

  1. Go to Platforms/ios/cordova/build.xcconfig and comment out following lines - 30,31 & 43

       30. //CODE_SIGN_IDENTITY = iPhone Developer
        31. //CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
        43. //CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
  2. Go to the root folder and do the cordova build ios --buildConfig. This may fail. thats because of the absence of Debug-iphonesimulator in DerivedData.

  3. Then open the project in Xocde. Build there. Go and check the Deriveddata->...->Debug-iphonesimulator. You will see all those Pod dependencies there.

  4. Now come back to command line and run cordova build ios --buildConfig. this will build the project successfully.

GlenMasters commented 6 years ago

@AnanthaKrish

Hi, I am now getting a different error:

=== BUILD TARGET BMSAnalyticsAPI OF PROJECT Pods WITH CONFIGURATION Debug ===

Check dependencies
Code Signing Error: BMSAnalyticsAPI does not support provisioning profiles. BMSAnalyticsAPI does not support provisioning profiles, but provisioning profile NO_SIGNING/ has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor.

** ARCHIVE FAILED **

The XCode build worked and deployed successfully both to the simulator and a physical device.
(Since we made the change to build.xconfig Xcode no longer asks for the swift versions of the Pod files to be set. So the build was done with no changes to the project settings).

The pod files dependencies were all created in the Deriveddata->...->Debug-iphonesimulator folder.

AnanthaKrish commented 6 years ago

@GlenMasters hi, open the project Xcode, in pods BMS__-> Build settings change the NO_SIGNING to Automatic.

Then run the build command in terminal

GlenMasters commented 6 years ago

@AnanthaKrish

Ok - I have done that. I now get this error:

** ARCHIVE FAILED **

The following build commands failed:
        Ld /Users/glenmasters/Library/Developer/Xcode/DerivedData/G&TT_2018-ddzadtounszdnzaljzuvbkiomeue/Build/Intermediates.noindex/ArchiveIntermediates/G&TT\ 2018/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/BMSAnalyticsAPI.build/Objects-normal/arm64/BMSAnalyticsAPI normal arm64
        Ld /Users/glenmasters/Library/Developer/Xcode/DerivedData/G&TT_2018-ddzadtounszdnzaljzuvbkiomeue/Build/Intermediates.noindex/ArchiveIntermediates/G&TT\ 2018/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/BMSAnalyticsAPI.build/Objects-normal/armv7/BMSAnalyticsAPI normal armv7
(2 failures)
(node:2226) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error code 65 for command: xcodebuild with args: -xcconfig,/Users/glenmasters/Documents/workspace/Celadin-Lime2/platforms/ios/cordova/build-debug.xcconfig,-workspace,G&TT 2018.xcworkspace,-scheme,G&TT 2018,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,G&TT 2018.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/glenmasters/Documents/workspace/Celadin-Lime2/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/glenmasters/Documents/workspace/Celadin-Lime2/platforms/ios/build/sharedpch,EMBEDDED_CONTENT_CONTAINS_SWIFT = YES,ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO,LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"
(node:2226) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
AnanthaKrish commented 6 years ago

@GlenMasters Archive it through Xcode .. Else use Xcode commad line tools to archive .

GlenMasters commented 6 years ago

@AnanthaKrish

I am trying to achieve a command line build. I need this for our CI process. Archiving through XCode defeats this purpose. I can already build through XCode. As far as using XCode command line tools is concerned - this is what cordova already does and reports Archive Failed.

AnanthaKrish commented 6 years ago

@GlenMasters Which command are you trying ?

GlenMasters commented 6 years ago

@AnanthaKrish

cordova build ios --buildConfig 
AnanthaKrish commented 6 years ago

@GlenMasters Try removing the buildFlag values from build.json. Retry the build after that

GlenMasters commented 6 years ago

@AnanthaKrish

No that didn't work. Archive failed again.

Is there a working demo for this that I could fork from or clone?

AnanthaKrish commented 6 years ago

@GlenMasters this is a apache cordova issue ... This issue will come when there is a pod dependencies. I will try to find way, will let you know.

No there is no working model for CI builds.

ayushbafna24 commented 6 years ago

Hii Anatha,This BMS push not working in iPhone 5s device.It gives me a error dylib fatal error and image not found.It works on emulerator and Android real devices but it gives me a fatal error When running on a iPhone real devices through xcode.Need your urgent support.Please help me regarding these.

ayushbafna24 commented 6 years ago

Hii Anatha,This BMS push not working in iPhone 5s device.It gives me a error dylib fatal error and image not found.It works on emulerator and Android real devices but it gives me a fatal error When running on a iPhone real devices through xcode.Need your urgent support.Please help me regarding these.

AnanthaKrish commented 6 years ago

@ayushbafna24 Hi, please do a pod install or pod update inside platforms/ios. Then open the project.XCWorkspace.

Do a clean build (cmd+shift+option+k) then cmd+b

This should solve the issue

ayushbafna24 commented 6 years ago

Please provide your IBM intranet id.I am working in IBM,Noida.I need your support on urgent basis.we have stuck to these issues from 5 days.Please help regarding these issue.So I have arranged a meeting with you.I have tried everything you have asked me.My issue has not solved.

On Feb 5, 2018 11:02 PM, "Anantha Krishnan K G" notifications@github.com wrote:

@ayushbafna24 https://github.com/ayushbafna24 Hi, please do a pod install or pod update inside platforms/ios. Then open the project.XCWorkspace.

Do a clean build (cmd+shift+option+k) then cmd+b

This should solve you rissue

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push/issues/90#issuecomment-363158764, or mute the thread https://github.com/notifications/unsubscribe-auth/ALj8N_6Sv9Ssl9Tz_D92IlRX93-E4Oouks5tRzsugaJpZM4RUPkO .

AnanthaKrish commented 6 years ago

@ayushbafna24 Please create service ticket.

ayushbafna24 commented 6 years ago

Please provide me a url.I will create a service ticket for these.Please provide me soon as possible.This is an urgent issue.We except as your kind support.My Ibm intranet I'd is ayubafna@in.ibm.com

On Feb 6, 2018 10:50 AM, "Anantha Krishnan K G" notifications@github.com wrote:

@ayushbafna24 https://github.com/ayushbafna24 Please create service ticket.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push/issues/90#issuecomment-363314052, or mute the thread https://github.com/notifications/unsubscribe-auth/ALj8Ny3srHtaVo2lBSsCUg7xReY3dXKXks5tR-EEgaJpZM4RUPkO .

ayushbafna24 commented 6 years ago

I am waiting for your response

On Feb 6, 2018 11:03 AM, "Ayush Bafna" ayushbafna.88@gmail.com wrote:

Please provide me a url.I will create a service ticket for these.Please provide me soon as possible.This is an urgent issue.We except as your kind support.My Ibm intranet I'd is ayubafna@in.ibm.com

On Feb 6, 2018 10:50 AM, "Anantha Krishnan K G" notifications@github.com wrote:

@ayushbafna24 https://github.com/ayushbafna24 Please create service ticket.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push/issues/90#issuecomment-363314052, or mute the thread https://github.com/notifications/unsubscribe-auth/ALj8Ny3srHtaVo2lBSsCUg7xReY3dXKXks5tR-EEgaJpZM4RUPkO .

andaqui commented 6 years ago

We are having the same issue. Everything works through xcode, receiving push and so on. But through command line build we also get:

** ARCHIVE FAILED **

The following build commands failed:
    Ld /Users/andres/Library/Developer/Xcode/DerivedData/Art_Andersen_CPH-cwjuacqymuiidqgpslsvkfmghdyv/Build/Intermediates.noindex/ArchiveIntermediates/Art\ Andersen\ CPH/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/BMSAnalyticsAPI.build/Objects-normal/armv7/BMSAnalyticsAPI normal armv7
(1 failure)
andaqui commented 6 years ago

Yes. Im wondering if you found a command line solution. Would be very helpful for our launch procedures.

On 6 Feb 2018, at 11:14, Anantha Krishnan K G notifications@github.com wrote:

@kumpanen https://github.com/kumpanen This is an issue with the Cordova. When there is a pod dependency its complaining about the pod dependency. Please Use Xcode to archive your app.

AnanthaKrish commented 6 years ago

@kumpanen We are trying to find a solution. As of now please use the Xcode directly to archive ..

zamrokk commented 6 years ago

You need to have cordova 6.3.0 to create and build first your project in XCode. Then change the compilation Swift to 3.2 and it should be good