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

CocoaPods, Reachability, and use_frameworks! #95

Open
g0ld2k opened this Issue Mar 19, 2015 · 20 comments

Comments

Projects
None yet
@g0ld2k
Copy link

g0ld2k commented Mar 19, 2015

With CocoaPods 0.36, they added the capability to generate frameworks for pods. For Swift projects, using frameworks eliminates the need for a Objective-C bridge.

Podfile:

    # Uncomment this line to define a global platform for your project
    platform :ios, "8.0"
    use_frameworks!

    target "VB ParkFinder" do
    pod 'ArcGIS-Runtime-SDK-iOS', '~> 10.2'
    pod 'Reachability', '~> 3.2'
    pod 'TUSafariActivity', '~> 1.0.3'
    pod 'NHCalendarActivity', '~> 0.0.1'
    end

    target "VB ParkFinderTests" do

    end

Reachability works great as a Framework, however when submitting the app to Apple, Apple incorrectly identifies Reachability as being a private API (it looks like there is a private API class called Reachability), which causes the app to be rejected.

Dear developer,

We have discovered one or more issues with your recent delivery for "VB ParkFinder". To process your delivery, the following issues must be corrected:

Non-public API usage:

The app contains or inherits from non-public classes in VB ParkFinder: Reachability

If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.

If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's nine-digit Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com. For further information, visit the Technical Support Information page.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team

None of the other Pods in my project caused this issue.

I was able to work around the issue by removing the use_frameworks! line from my Podfile and creating a Objective-C bridging file, no other code was changed. My submission without use_frameworks! passed Apple's initial checks without a problem.

I'm not sure what the solution would be, but it sounds like there is a collision occurring with Apple's private frameworks due to the naming of your project.

@tonymillion

This comment has been minimized.

Copy link
Owner

tonymillion commented Mar 21, 2015

Thats a new one! The solution, I suppose, would be to rename the framework as something else while keeping the name for compiled projects?

@albertbori

This comment has been minimized.

Copy link

albertbori commented Apr 1, 2015

+1

Got rejected for the same reason. I'd rather not remove use_frameworks!. Is there another quick solution for this?

@g0ld2k g0ld2k referenced this issue Apr 1, 2015

Open

App rejection #96

@Cinamonas

This comment has been minimized.

Copy link

Cinamonas commented Apr 10, 2015

+1

Our's got rejected due to this, too.

@formvoltron

This comment has been minimized.

Copy link

formvoltron commented Apr 19, 2015

time for a rename it seems.

@tonymillion

This comment has been minimized.

Copy link
Owner

tonymillion commented Apr 20, 2015

I agree - I have a lot of work right now, but I'd like to look into if you can detect when being compiled as a framework and change the class name dynamically.

@formvoltron

This comment has been minimized.

Copy link

formvoltron commented Apr 20, 2015

Why not just TMReachability? We'll know it's still Reachability under the
hood. :)

On Mon, Apr 20, 2015 at 11:09 AM, Tony Million notifications@github.com
wrote:

I agree - I have a lot of work right now, but I'd like to look into if you
can detect when being compiled as a framework and change the class name
dynamically.


Reply to this email directly or view it on GitHub
#95 (comment)
.

@salabaha

This comment has been minimized.

Copy link

salabaha commented Apr 28, 2015

Faced the same problem today. Renaming should fix it.

@allaire

This comment has been minimized.

Copy link

allaire commented May 8, 2015

👍

@cpatterson

This comment has been minimized.

Copy link

cpatterson commented May 28, 2015

I'm also facing this problem. Can't remove use_frameworks! because we're using some Swift pods.
None of the forks I've looked at seem to rename everything properly for CocoaPods.

@albertbori

This comment has been minimized.

Copy link

albertbori commented May 28, 2015

@cpatterson I forked and use this regularly to get my app into the app-store. It might be a few fixes behind. I was planning on bringing it up-to-date soon™ (if needed): https://github.com/albertbori/Reachability

@tonymillion I recommend renaming the items in question to TMReachability instead of chasing the golden helicopter solution. Especially since this issue is a) a blocking issue, and b) over two months old.

@tylrtrmbl

This comment has been minimized.

Copy link

tylrtrmbl commented Jun 24, 2015

@tonymillion: you added the big warning in the README for this issue; but if you don't mind me saying, that's not really a solution that helps a CocoaPods user, which is where this issue was discovered. 😉

TMReachability?

@warpling

This comment has been minimized.

Copy link

warpling commented Jul 9, 2015

I'm struggling a bit with this. I renamed Reachability's files and classes and successfully submitted to Apple but after a pod install I am getting linker errors with TMReachability. Is there a correct way to fix this via the pod or should I just ditch the pod in favor of my own fork or copying in the files manually?

@Cinamonas

This comment has been minimized.

Copy link

Cinamonas commented Jul 10, 2015

@warpling: as per @albertbori suggestion, that's what I'm currently doing:

pod 'TMReachability', :git => 'https://github.com/albertbori/Reachability', :commit => 'e34782b386307e386348b481c02c176d58ba45e6'
@warpling

This comment has been minimized.

Copy link

warpling commented Jul 10, 2015

Thanks @Cinamonas, I missed that! I ended up just pulling in the two files and renaming them.

@wasnotrice

This comment has been minimized.

Copy link

wasnotrice commented Jul 17, 2015

@albertbori thanks for sharing your fork. fixed this issue for me!

@dougdiego

This comment has been minimized.

Copy link

dougdiego commented Jul 22, 2015

+1

1 similar comment
@parallaxe

This comment has been minimized.

Copy link

parallaxe commented Jul 27, 2015

+1

@DaveCole

This comment has been minimized.

Copy link

DaveCole commented Aug 14, 2015

@Cinamonas solution somehow works for me when I run it on the phone, but fails when I attempt an App Store archive. Anyone else run into this?

@warpling

This comment has been minimized.

Copy link

warpling commented Aug 14, 2015

@DaveCole different target for release/debug perhaps? Can you run it on your phone in release mode? (You can change the mode in Product > Edit Scheme)

@aaronschachter aaronschachter referenced this issue Oct 5, 2015

Closed

Handle offline connection #91

0 of 1 task complete
@dlo

This comment has been minimized.

Copy link

dlo commented Aug 17, 2017

@Cinamonas Thanks so much for creating that fork! Works great. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment