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 8 App Submission Fails App Store Validation with 1Password SDK #95

Closed
cnstoll opened this issue Sep 10, 2014 · 38 comments
Closed

iOS 8 App Submission Fails App Store Validation with 1Password SDK #95

cnstoll opened this issue Sep 10, 2014 · 38 comments

Comments

@cnstoll
Copy link

cnstoll commented Sep 10, 2014

Hola,

We are running into an issue with submitting an app to the App Store using the 1Password SDK. The validation fails saying that our app contains private API usage in the WebKit framework. The only thing in our app using WebKit is the 1Password extension SDK, and when we remove the SDK, the validation passes.

I'm not sure what the deal is here, but have you guys seen this and if so do you have any suggestions on next steps?

Thanks,

  • Conrad
@roustem
Copy link
Member

roustem commented Sep 10, 2014

Are you building with iOS 8 SDK or iOS 7?

@roustem
Copy link
Member

roustem commented Sep 10, 2014

Also, do you get the name of the private API in the error message?

@cnstoll
Copy link
Author

cnstoll commented Sep 10, 2014

Building with the iOS 8 GM SDK. We didn't get any info on a specific method either. All it mentioned was the framework.

I'm wondering if it could possibly be related to this issue?

https://devforums.apple.com/message/1011314#1011314

When we build and archive Xcode attempts to generate a .pkg file instead of a .ipa file. I am wondering if it thinks we are building a Mac app, and could be linking against a Mac version of WebKit?

(If you've noticed anything about the .pkg issue that would be super helpful too. I think its related to the fact that we have our own extension embedded in the app).

@roustem
Copy link
Member

roustem commented Sep 10, 2014

This is strange. We were lucky to Archive and then Submit to the App Store from Xcode. Are you using the Application Loader or submitting directly from Xcode Organizer?

@dougkeen
Copy link

We've been having to use the Application Loader with a manually built ipa file for now until we get that other .pkg file issue sorted out.

@dougkeen
Copy link

It may also be worth noting that our app includes support for iOS 7.

@mwhuss
Copy link

mwhuss commented Sep 11, 2014

I just got this same validation issue with out app.

  • Supporting iOS 7.1+
  • We also have a today extension in our App
  • WebKit is only being used from the 1password extension
  • We're installing via Cocoapods

image

@roustem
Copy link
Member

roustem commented Sep 11, 2014

I believe there is a public WebKit.framework under iPhoneOS.sdk. Can you see it?

@mwhuss
Copy link

mwhuss commented Sep 11, 2014

Yea, I found it under iPhoneOS.sdk/System/Library/Frameworks/Webkit.framework. It's also weird that there isn't a iPhoneOS.sdk/System/Library/PrivateFrameworks/Webkit.framework, just WebKitLegacy.framework.

@roustem
Copy link
Member

roustem commented Sep 11, 2014

Thank you, @mwhuss! Do you think we have a bug in Cocoapods definitions that causes the wrong framework get linked?

@mwhuss
Copy link

mwhuss commented Sep 11, 2014

Possibly. I'll try manually copying the files into my project tomorrow and will see if it passes validation then.

@cnstoll
Copy link
Author

cnstoll commented Sep 11, 2014

Just confirming that we are seeing the same thing, link to the PrivateFrameworks version of WebKit rather than something more public. Sorry I didn't notice that sooner!

@larsacus
Copy link

The only thing that strikes me as odd about the cocoa pods install (i just updated cocoa pods to the latest and did a pod update to bring in the 1PasswordExtension pod) is that instead of link to an actual framework in 'Build Phases', it has insert the framework textually in the build settings:

screen shot 2014-09-10 at 10 07 11 pm

What I normally see, but with the framework in question added, just with the "Optional" identifier, but it is missing here:
screen shot 2014-09-10 at 10 07 39 pm

Might try adding it manually with the "+" so it looks normal and deleting the textual reference just to see if it will not link to the private version:
screen shot 2014-09-10 at 10 09 31 pm

You can see here it links to the non-private version here, although I haven't tried submitting to the store in this configuration.
screen shot 2014-09-10 at 10 11 00 pm

If this works, there is likely an issue with cocoa pods and the new Xcode 6.

@cruffenach
Copy link

Anyone successfully gotten around this issue?

@distefam
Copy link

@larsacus I can confirm that this works. We just submitted after applying the changes you specified. Thank you!

One thing to look out for is that you need to set these linking instructions on the specific pod file target, not your app's build target. To reiterate:

  1. Delete the text references to the Webkit framework in Build Settings
  2. Link the framework with an optional value under "link frameworks" in Build Phases

Thanks again, this saved a bunch of headaches on our part.

@larsacus
Copy link

@distefam Correct -- This is in the 1PasswordExtension lib target that CocoaPods creates.

I stated earlier that if this worked, the bug was likely in CocoaPods, but after I thought about it more, why is Xcode implicitly linking to a private framework, especially if there is a public counterpart?? I feel like since this works for some but not others, the list of frameworks internally might be indeterminate and in some way random luck as to if the private or public version of the framework gets linked using the textual specification.

(╯°□°)╯︵ ┻━┻

@mwhuss
Copy link

mwhuss commented Sep 11, 2014

I was also able to get past the validation with @larsacus's solution. I also had to go into my app's target Other Linker Flags and remove -framework WebKit.

@segiddins
Copy link

This seems to me like an Xcode bug. Has anyone radared?

@jasongurwin
Copy link

I'm trying to find solution to this more generally. It seems that Xcode has a bug if you want to support iOS8 + Webkit, as well as iOS7 with UIWebView. I filed a support ticket, but haven't heard back yet.


When compiling our iOS app, it seems to be linking with the private WebKit framework, even though it is a public framework. The fact that it is using the private framework causes rejection when attempting to submit to the App Store.

Using "otool -L" shows the private framework: "/System/Library/PrivateFrameworks/WebKit.framework/WebKit (compatibility version 1.0.0, current version 600.1.4)".

This is only an issue when our Deployment Target is below 8.0. We want to keep iOS 7 support, so our deployment target is "7.0". When we change this to "8.0", otool reports "/System/Library/Frameworks/WebKit.framework/WebKit (compatibility version 1.0.0, current version 600.1.4)". Using "7.1" also causes the issue.

The WebKit framework is set to optional.

This issue also can be reproduced in a sample project that is a standard Xcode template, with the only changes being:

  1. Using the WebKit framework (set to optional/required).
  2. Setting the Deployment Target to 7.0.

STEPS TO REPRODUCE
Attempt to compile our application or sample project with WebKit included and a Deployment Target of 7.0.

@lordkev
Copy link

lordkev commented Sep 13, 2014

@jasongurwin Let me know if you find a solution. We're having a similar issue, unrelated to 1Password.

@jasondinh
Copy link

I know this is weird but I removed WebKit framework from my project and was still able to compile. No crash on both iOS 7 & 8 - passed Xcode validation.

Sample project: http://tinywhale.s3.amazonaws.com/webkitTest.zip

@soleares
Copy link

@Xuki system frameworks link automatically as of Xcode 5 so there's no need to add them in the project settings. That's why it's working. See http://tonyarnold.com/2014/04/10/clean-up-your-projects-with-xcode-5.html

@jasongurwin
Copy link

Anyone find a solution?

@soleares
Copy link

@jasongurwin try not linking the framework. Xcode auto links system frameworks when you @import / #import them.

@cnstoll
Copy link
Author

cnstoll commented Sep 15, 2014

We've also been able to get past validation using the solution above from @larsacus.

@jasongurwin
Copy link

@soleares - unfortunately doesn't work when selecting iOS7 as the deployment target.

@jasondinh
Copy link

@jasongurwin did you enable Link Frameworks Automatically in your project?

@jasongurwin
Copy link

Yes - no luck unfortunately.

On Sep 14, 2014, at 7:50 PM, Jason Dinh notifications@github.com wrote:

@jasongurwin did you enable Link Frameworks Automatically in your project?


Reply to this email directly or view it on GitHub.

@lordkev
Copy link

lordkev commented Sep 15, 2014

We did find a way to get it built with an iOS 7 deployment target, submitted, and passing validation. We did the following:

  • Remove WebKit as a linked framework
  • Replace any instances of [WKWebKit class] being used as runtime checks, as well as the initial [WKWebKit alloc], with NSClassFromString("WKWebKit") -- this avoids the missing symbols from the framework not being linked
  • Dynamically load the framework at runtime using dlopen("/Library/Frameworks/WebKit.Framework/WebKit", RTLD_LAZY), wrapped in an iOS 8 check.

This passed validation and should be fine, as iOS 8 now supports dynamically loading embedded frameworks and dylibs, but I guess we'll see what the review team says.

I may go back to make sure that all of these steps were completely necessary, but after we got it submitted late Friday night I was done for the weekend. :)

@jasongurwin
Copy link

Thanks Kevin! That did the trick for us too.

@chrismanderson
Copy link
Contributor

I have seen the same issue in terms of submitting. My app is targeted at 7.0. I added weak linking to the 1Password for the WebKit framework. But I'm still seeing validation errors when submitting.

@ZZBHuang
Copy link

+1 still validation error after trying all solutions above

@radazzouz
Copy link
Contributor

We just released version 1.0.9, can you guys confirm if it works when using CocoaPods?

@mpvosseller
Copy link
Contributor

The solution that worked for me is to not explicitly link against WebKit.

Step 1- Ensure Link Frameworks Automatically is YES in Build Settings of both your project and the Pods project.
Step 2- Remove any instances of -weak_framework WebKit or -framework WebKit from any build configuration files you find it in. For me it was in Pods/Pods-1PasswordExtension.xcconfig and Pods/Pods.xcconfig
Step 3- You will need to repeat the above each time you pod update or pod install

@williamsjj
Copy link

I can confirm this still happens with 1.0.9. Just ran our app through validation on Xcode 6:

/System/Library/PrivateFrameworks/WebKit.framework

@tangphillip
Copy link

We didn't have any validation issues, and we built with v1.0.8 with this one change: smup@af49640.

Our app doesn't use WKWebView, so we felt safe not linking WebKit.

@mwhuss
Copy link

mwhuss commented Sep 20, 2014

I've had 2 apps that failed validation at first, but work now. The solution for both of them was to:

  • Remove WebKit from the Build Phases > Link Binary with Libraries
  • Remove -weak_framework WebKit from my Other Linker Flags

@radazzouz
Copy link
Contributor

Hello everyone!

I will close this issue for now, since some of you are already in the App Store and successfully integrated with 1Password.

Thank you! 👍

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