Signing bugs with use_frameworks! and unique training profiles

I am inserting my last post from the Initial Discussion here:

https://github.com/CocoaPods/CocoaPods/issues/4331

This problem has existed for almost a year, and so far no correct solutions have been found.

While creating:

Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings ("MyDistributionProfileName") has an AppID of "com.myorg.myapp" which does not match your bundle identifier "org.cocoapods.PureLayout". 

Attention! PureLayout is added to my mod depending on usage (in mypod.podspec file): s.dependency 'PureLayout', '3.0.2'

This is the entire podspec file of my Pod:

 Pod::Spec.new do |s| s.name = 'MyPod' s.version = '1.2.34' s.license = { :type => "MIT", :file => "LICENSE" } s.homepage = 'https-:-//bitbucket.org/XXXX123/my-pod' s.authors = { "AuthorName" => " author@myorg.com " } s.summary = 'This isa a cocoa pod that contains the MY framework.' s.source = { :git => "https-:-//bitbucket.org/XXXX123/my-pod", :tag => "#{s.version}" } s.ios.deployment_target = '8.0' s.source_files = 'MyPod/**/*.{swift,h}' s.resource = 'MyPod/*' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'ONLY_ACTIVE_ARCH' => 'NO'} s.dependency 'PureLayout', '3.0.2' end 

Notes:

  • Disabling the use of CocoaPods is not an option.

  • Using @DimaVartanian fix leads to similar errors, for example, encountered by @mgrebenets

    ERROR ITMS-90035 Invalid signature. The code object is not signed at all. Make sure you sign the application with a distribution certificate and not a special certificate or development certificate. Make sure that the code signing options in Xcode are correct at the target level (which override any values ​​at the project level). Also, make sure that the package you download was created using the Release target in Xcode, and not for the Simulator target. If you are sure that your code signing settings are correct, select "Clear All" in Xcode, delete the "build" directory in Finder and rebuild the release target. For more information, see https:: - // developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html "

    ERROR ITMS-90171 Invalid Bundle structure - binary "XApp.app/Frameworks/X.framework/XView.o" is not allowed. The can not application contains standalone executables or libraries other than the CFBundleExecutable supported packages. See the Bundle programming guide at https -: - // developer.apple.com/go/?id=bundle-structure for information on the structure of the iOS application package.

  • My project also uses PushNotifications, so it cannot use wildcard submission profiles.

  • Here is my gymnastics line for building an assembly

     gym --clean --scheme ${XCODE_PROJECT_TARGET_NAME} --configuration Release --include_bitcode false --archive_path ${BUILDS_DIR}${PACKAGE_NAME}.xcarchive --output_directory $BUILDS_DIR --output_name "${PACKAGE_NAME}.ipa" --xcargs PROVISIONING_PROFILE=$APP_PROVISION_UUID 

    This line works without errors when applying @DimaVartanian fix, but, as indicated above, it leads to ERROR ITMS-90035 and ERROR ITMS-90171 during the boot process.

    Here is my experimental line for loading the assembly:

     pilot upload --skip_submission --username ${APPLE_ID_USERNAME} --team_id ${APPLE_ITUNES_CONNECT_TEAM_ID} --verbose --ipa ${BUILDS_DIR}${PACKAGE_NAME}.ipa --skip_waiting_for_build_processing true 
  • I can also confirm that the same problem occurs when building / archiving / unloading using xcode.

  • Adding this command line --export_options "ExportOptions.plist" to the gym did not matter. Also failed with xcargs --xcargs "PROVISIONING_PROFILE=$APP_PROVISION_UUID exportOptionsPlist=$EXPORT_OPTIONS_PLIST" .

    The contents of the file are as follows:

     <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>teamID</key> <string>TEAMID123</string> <key>uploadSymbols</key> <string>NO</string> <key>compileBitcode</key> <false/> <key>uploadBitcode</key> <false/> <key>method</key> <string>app-store</string> </dict> </plist> 

I hope the CocoaPods team fix this quickly.

In short, failure is the end of the following sequence:

  • Create a basic project in Objectvie-C or take any old Objective-C project
  • Build and implement a framework project (Cocoa Touch Framework) in Swift
  • Create podspec for this structure and upload it to the repository
  • Include this structure in a base project using CocoaPods
  • Creating and running the application on the simulator and on the wired device is fine (everything works as expected)
  • Build and / or upload to iTunesConnect NOT APPROVED, DO NOT!

I will try to add a sample project later to reproduce the problem.

+7
ios objective-c xcode swift cocoapods
source share
1 answer

Ok, so this time I solved this problem in my own way. As usual, the solution is simpler than ever thought.

The cause of the bugger ERROR ITMS-90171 error this time was the directive in the podspec file.

This: s.resource = 'MyPod/*'

I don’t know how I skipped this, but β€œMyPod / *” literally says, include everything in the MyPod directory, which in addition to graphic resources also contains * .swift files.

So, a little fix by changing this line to: s.resource = 'MyPod/Graphics.xcassets' fixed the problem. No ERROR ITMS-90171.


However, here we still need to deal with a workaround (proposed by @DimaVartanian) that corrects the code signing requirement for the frameworks provided by cocoapods.

The fix itself is to add this code to the base Subfile project:

 post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" end end end 

This will (after installing "pod install") through all pod targets in the project and remove the code signing requirement by changing some parameters, as you can see in the code.

There are rumors that this workaround will no longer be required after upgrading to Xcode 8. I have not found official confirmation of this, but I hope that this is true.

+2
source share

All Articles