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

Xcode10 beta can't load bundles from CocoaPods #7823

Closed
hengyizhangcn opened this Issue Jun 12, 2018 · 21 comments

Comments

Projects
None yet
4 participants
@hengyizhangcn
Copy link

hengyizhangcn commented Jun 12, 2018

There are some libraries imported by Cocoapods. Like SVProgressHUD, etc.

When using Xcode10 beta to build the project, it's confirmed that the bundles imported by CocoaPods can't loaded to the app bundle.
Neither the simulator nor the true device, it happes every time.

But when using the Xcode version before 10, like 9.x, the problem is gone!
(Tips: pod version 1.3.1)

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 12, 2018

Hello! Thanks for the report, is it possible to upload a sample app with this issue?

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 12, 2018

It helps us a lot to diagnose and debug quicker but I can try to create my own sample.

@hengyizhangcn

This comment has been minimized.

Copy link
Author

hengyizhangcn commented Jun 12, 2018

@dnkoutso ,there is a demo
https://github.com/hengyizhangcn/CocoaPodsIssuesDemo.git

when running the demo, you can add a breakpoint at the file SVProgressHUD.m, line 357. The bundle resources 'SVProgressHUD.bundle' in the pods is exist. But not loaded to the app bundle when build.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 12, 2018

excellent thanks!

@allenhumphreys

This comment has been minimized.

Copy link

allenhumphreys commented Jun 14, 2018

Also had this issue, seems to be a problem with the new build system, not necessarily Xcode 10. The new build system is simply skipping the [CP] Copy Pods Resources script because it specifies an output folder (${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}) which is already created by some other task.

In the build log, you can see this warning:
screen shot 2018-06-14 at 11 15 45 am

And if you filter down on "Run" you'll see the script is not invoked.
screen shot 2018-06-14 at 11 19 55 am

Work arounds
Removing the "Output Files" entry manually fixes the issue. Overriding the default usage of the new build system will also fix the issue.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

@allenhumphreys what version of CocoaPods are you using?

@allenhumphreys

This comment has been minimized.

Copy link

allenhumphreys commented Jun 14, 2018

1.3.1

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

@allenhumphreys this is fixed in >= 1.4.0 with #7209

I am inclined to resolve the issue but for now will keep it open and wait for sample or input from the original author.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

I am blind. There is a sample :)

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

@hengyizhangcn what version of CocoaPods were you using?

@allenhumphreys

This comment has been minimized.

Copy link

allenhumphreys commented Jun 14, 2018

@dnkoutso I upgraded to 1.5.3 and I'm still seeing this issue.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

If you remove the copy resources phase and pod install again do the input/output paths still include ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}?

@allenhumphreys

This comment has been minimized.

Copy link

allenhumphreys commented Jun 14, 2018

@dnkoutso My bad, it's actually working fine!

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

I guess is the problem that ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH} is present as a root folder or just any other resource already copied? If its the latter then this is a problem.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 14, 2018

ah ok! :D

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 15, 2018

thanks, I think we slightly derailed here on the issue. Your original might still be a problem but I haven't yet checked. Need Xcode 10 beta to be installed.

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 15, 2018

@hengyizhangcn I could not reproduce.

The bundle is copied and it loads properly in the debugger. I do not see anything in the sample app, should I?

screen_shot_2018-06-14_at_10_34_55_pm

@hengyizhangcn

This comment has been minimized.

Copy link
Author

hengyizhangcn commented Jun 15, 2018

It's approved that the project which created by CocoaPods version 1.3.1 or before can't run on Xcode10 beta.
According to dnkoutso's advice, update to the newest CocoaPods, remove Copy Pods Resources in the Build Phases and pod install again, the problem is gone! Simply, don't do any remove operation, just pod install again after upgrade CocoaPods, the result is the same.
If the project is newly created by CocoaPods version 1.5.3(1.4.0 or later), it's unnecessary to worry about this issue described in #7823.
Many thanks to @dnkoutso @allenhumphreys !

@dnkoutso

This comment has been minimized.

Copy link
Contributor

dnkoutso commented Jun 15, 2018

great! thanks for posting this for the next person who might hit this problem.

@hengyizhangcn

This comment has been minimized.

Copy link
Author

hengyizhangcn commented Jun 15, 2018

This issue just tells us, it is very important to keep pace with the CocoaPods version release!

@wolffan

This comment has been minimized.

Copy link

wolffan commented Sep 19, 2018

I can reproduce this problem with Cocoapods version 1.3.5

The solution provided here (deleting the Copy won't work, assuming Copy is now Embed) doesn't work.

I've tried also moving to old build system and won't work either

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