ra1028 / Carbon

🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.
https://ra1028.github.io/Carbon
Apache License 2.0
1.33k stars 97 forks source link

Compilation error "Carbon is not available when building for iOS Simulator" #73

Open nonameplum opened 4 years ago

nonameplum commented 4 years ago

Checklist

Expected Behavior

The example application compiles without the error message

Current Behavior

~/Carbon/Examples/Example-iOS/Example-iOS.xcodeproj Carbon is not available when building for iOS Simulator.

Steps to Reproduce

Install Xcode 11.4 Follow the steps to run the example app from the README.

Reproducible Demo Project

The as is Example app from the Carbon repository.

Environments

I was thinking that this is related to CocoaPods only but seems like the Example app from the Carbon that is not using CocoaPods to resolve dependencies has the same issue in Xcode 11.4.

bofeizhu commented 4 years ago

I think there is a name conflict with macOS's Carbon framework. The only solution might be renaming the framework to something else.

ra1028 commented 4 years ago

@nonameplum

Thanks for your reporting.

I fixed this problem by here. Please check it with the master branch.

nonameplum commented 4 years ago

@ra1028 Yes, the issue is fixed in the example app but I'm not sure how this can be fixed with cocoapods. Any thoughts?

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

bofeizhu commented 4 years ago

@nonameplum @ra1028 I think we probably have to rename Carbon to something else to fix the CocoaPods issue. You can see my comment above.

nonameplum commented 4 years ago

@bofeizhu You are correct. After the framework rename problem is solved.

ra1028 commented 4 years ago

@bofeizhu @nonameplum

I created a sample project and tried to install Carbon with CocoaPods and it worked, can you tell me more about the error?

Anyway, changing the framework name is too big a breaking change. I think it's a bug depends on Xcode11.4.0 or CocoaPods, as there are no problems with Carthage. I was disappointed in the overly throwaway response of the CocoaPods maintainers. I think that should be pursued more on the CocoaPods side.

The workaround you can do now is to rewrite the framework name in the CocoaPods post-install script, or use Carthage.

bofeizhu commented 4 years ago

@ra1028 The issue only happens when Carbon is used as a dependency in another pod. To reproduce, you can create a development pod and add Carbon as a dependency in its podspec. Then install the development pod to a project, the error would occur. I agree changing the name is too big at this point. But considering Apple could potentially ban the use of Carbon (their old 32-bit UI framework) entirely by filtering out frameworks by name in the future, it may still worth the hassle now. Maybe some subtle change like CarbonX? CarbonKit?

Goktug commented 4 years ago

Same problem +1

lnfnunes commented 4 years ago

I just discovered this lib and thinking to suggest the adoption in my company's project, wondering if this could be a problem since we use Cocoapods in the main project and on the frameworks (modules) as well!? 💭

nonameplum commented 4 years ago

@lnfnunes If you would like to use this framework in one of your frameworks then you will get this issue.

lnfnunes commented 4 years ago

Hum ok! 😞 Thanks @nonameplum

Goktug commented 4 years ago

@bofeizhu @nonameplum

I created a sample project and tried to install Carbon with CocoaPods and it worked, can you tell me more about the error?

Anyway, changing the framework name is too big a breaking change. I think it's a bug depends on Xcode11.4.0 or CocoaPods, as there are no problems with Carthage. I was disappointed in the overly throwaway response of the CocoaPods maintainers. I think that should be pursued more on the CocoaPods side.

The workaround you can do now is to rewrite the framework name in the CocoaPods post-install script, or use Carthage.

@ra1028 Please, reconsider for renaming pod name. Currently, the pod is release candidate, before releasing a stable version of it, you can change the name. Maybe, it can be causing more problems to be used the Apple library name in the future.

ra1028 commented 4 years ago

What hesitates me is that, as mentioned here, it's a failure that only occurs with the limited conditions, and there are many solutions that users can do. In my opinion, the correct decision is to keep the Carbon side of the equation as it is now, and the user should do workaround only when failing on the edge case.

bofeizhu commented 4 years ago

@ra1028 I think the same error would happen to any Mac-Catalyst projects using CocoaPods. It will not be a limited condition when Catalyst getting popular in the future.

ra1028 commented 4 years ago

@bofeizhu

same error would happen to any Mac-Catalyst projects

Have you actually faced this phenomenon?