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

This bundle is invalid - The file extension must be .zip. #21

Closed
mente opened this issue Jan 6, 2015 · 24 comments

Comments

Projects
None yet
8 participants
@mente
Copy link

commented Jan 6, 2015

Hello,

I'm really new to iOS development and especially how iOS builds are made. Working with project locally is just fine (using simulator). But I can't push build to any distribution system (testflight or Beta from Crashlytics). In fact it's pushed in both cases but in case of Crashlytics Beta it fails to install, in case of testflight I receive warning

This bundle is invalid - The file extension must be .zip.

Problem appeared when I've added swift frameworks to Podfile. Here's an example of my Podfile:

platform :ios, "8.0"

pod "NSLogger" #not used in project itself
pod "HanekeSwift", :git => "https://github.com/Haneke/HanekeSwift", :branch => "podspec"

In fact there are more pods but including at least one swift framework gives me such an error.
I can provide you any other information but I don't know which one is valuable. Logs, archives, xcodeproj?

Tried both 0.36.0.beta.1 and HEAD revision of pod

@ValCapri

This comment has been minimized.

Copy link

commented Jan 6, 2015

Did you try to remove Pods folder and Podfile.lock and re-do a fresh pod install?
I had this problem some time ago, I don't remember how I solve it.
I have successfully posted an app using CocoaPods 0,36.beta.1 to,Crashlytics and App Store.
The only problem I had was that Apple don't want to validate an iOS 7 compatible app with a dynamic framework (you must use a deployment target >= 8.0 like yours).

@mente

This comment has been minimized.

Copy link
Author

commented Jan 6, 2015

It was my original thought but I didn't try. Otherwise it should be noted somewhere in announcement of swift support.

Anyway you might be right. Will give it a try.

@mente

This comment has been minimized.

Copy link
Author

commented Jan 12, 2015

So I've tried recreating project several times with no luck. I narrowed down problem a bit to use_frameworks! without any swift dependencies, so my Podfile looks like this:

platform :ios, "8.0"

use_frameworks!
pod "NSLogger" #Not used in real project

And with this I still experience problem publishing build. Any clues?

@ValCapri

This comment has been minimized.

Copy link

commented Jan 12, 2015

No, maybe creating a repository with some example code that doesn't work for you can help.

@mente

This comment has been minimized.

Copy link
Author

commented Jan 12, 2015

I've created a repo with an example project. Have a look

@Pasta

This comment has been minimized.

Copy link

commented Jan 23, 2015

Did you solved this @mente ?

@mente

This comment has been minimized.

Copy link
Author

commented Jan 23, 2015

Nope

@Pasta

This comment has been minimized.

Copy link

commented Jan 23, 2015

I guess the solution is to not use cocoapods until 0.36 is released.

@mente

This comment has been minimized.

Copy link
Author

commented Jan 24, 2015

It's one way of the fix. But I couldn't find a similar issue in the internet so thought it could be just me. So just wanted to ensure that I'm doing everything correct

@albertbori

This comment has been minimized.

Copy link

commented Jan 26, 2015

Having the same issue, but only when deploying with a custom Scheme and Build Configuration. I'm guessing I don't have it set up correctly. If I use the standard Scheme and Build Configuration (Debug/Release), then I am able to deploy to iTunes Connect just fine.

*Edit: This setup worked before I referenced Swift libraries

@segiddins

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

@neonichu this seems to be another custom config issue?

@aahung

This comment has been minimized.

Copy link

commented Jan 27, 2015

I also have this issue.

@neonichu

This comment has been minimized.

Copy link
Member

commented Jan 27, 2015

Could anyone of you put an example project up that causes this? Currently unsure how to reproduce.

@aahung

This comment has been minimized.

Copy link

commented Jan 27, 2015

My Podfile is

platform :ios, '8.0'

target '***' do

pod 'JLToast'
pod 'Alamofire', '~> 1.1'

end

and I am trying to add use_frameworks!

I still got the same problem.

@aahung

This comment has been minimized.

Copy link

commented Jan 27, 2015

Guys, I think I found something, I unzip the .ipa files
ipa can pass iTunesConnect:
ipa can pass iTunesConnect
ipa saids "invalid binary":
ipa saids "invalid binary"
It seems Cocoapods forget to copy the frameworks instead it just create a link: (ls -l in terminal)
lrwxr-xr-x 1 Hung staff 235 Jan 27 18:44 JLToast.framework -> /Users/Hung/Library/Developer/Xcode/DerivedData/CityU_Sport_Facility-bmxqvxilvqqmqldcflwwgzqhebbs/Build/Intermediates/ArchiveIntermediates/CityU Sport Facility Looking Up/IntermediateBuildFilesPath/UninstalledProducts/JLToast.framework

@neonichu

This comment has been minimized.

Copy link
Member

commented Jan 27, 2015

That should have been fixed by #2871 - what's the difference between those two results, first one doing manual integration of Alamofire?

@aahung

This comment has been minimized.

Copy link

commented Jan 27, 2015

This is the only visible difference between the two archive. I think maybe it causes failure.

@albertbori

This comment has been minimized.

Copy link

commented Jan 27, 2015

@neonichu, this only happens to me when using a custom build configuration. See if the following causes it for you:

  1. Project -> Info -> Configurations -> + -> Duplicate "Release" Configuration.
  2. Name it QA.
  3. Reference a swift framework
  4. Run pod install, and you'll get a warning about pods not setting the base configuration for MyProject.qa.xcconfig.
  5. Find Pods/Target Support Files/Pods/Pods.qa.xcconfig and drag it into your main project
  6. Change your QA Base Configuration File to Pods.qa.
  7. Change your schema to build the project using the QA build configuration
  8. Archive your main project
  9. Export it
  10. Examine the contents against a build using Release build configuration
@albertbori

This comment has been minimized.

Copy link

commented Feb 6, 2015

After implementing use_frameworks!, not even my Release build config is working now. I can confirm what @aahung was saying, after examining the .app package contents. It's very clear that the alias to the framework is being copied into the .app package, instead of the actual framework files:

screen shot 2015-02-05 at 9 33 57 pm

(Left image is deployable without issue, Right image is one that gets rejected with "This bundle is invalid - The file extension must be .zip")

@danilotorrisi

This comment has been minimized.

Copy link

commented Feb 8, 2015

I have the exact same issue here, as you've already said the problem is related to the aliases. Have you find any kind of workaround?

@aahung

This comment has been minimized.

Copy link

commented Feb 8, 2015

I plan to wait for the stable version of cocoapods. Right now I use objective c.

@danilotorrisi

This comment has been minimized.

Copy link

commented Feb 8, 2015

I'll also wait for the stable version, but I was trying to deploy just the beta version for now.

I've tried to manually copy the frameworks from the intermediate folder path ( where the aliases point to ) to the app framework folder. I'm trying to upload the binary to iTunes Connect, I'll let you know if that worked ( UPDATE: nope it didn't ).

The problem seems to be related to the Embed Pods Framework build phase, the /bin/sh script that runs seem to have some kind of syntax error on this if clause:

if [ -L ${source} ]; then
  echo "Symlinked..."
  source=$(readlink "${source}")
fi

I'm not a shell programmer so I have no idea if that is correct or not, what I'm trying now is to remove the if clause to "force" the readlink command in order to copy the actual framework instead of the alias.

@albertbori

This comment has been minimized.

Copy link

commented Feb 9, 2015

Just found an interesting warning in the build log (report navigator) in Xcode:

/Users/me/dev/myproject/MyProject/../Pods/Target Support Files/Pods/Pods-frameworks.sh: line 14: [: /Users/me/Library/Developer/Xcode/DerivedData/MyProject-ecinfzhnelbxxegrpzcpwnezmvot/Build/Intermediates/ArchiveIntermediates/MyProject: binary operator expected

Line 14 happens to be the first line in @danilotorrisi 's snippet. I'm guessing this failure is causing the symlink handling code to fail.

@albertbori

This comment has been minimized.

Copy link

commented Feb 9, 2015

Symlink copy was failing because of spaces in the source path. I have a pull-request in to fix this, and have verified that the fix allows the build through the itunes connect screening.

@segiddins segiddins closed this Feb 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.