Closed dcristolovean closed 4 years ago
I just tried on an empty Objective-C project with a vanilla Podfile (without PodBuilder) and a single AWSMobileClient pod and that same error popups. Then I added one single swift file to the target containing AWSMobileClient and the error did no longer appear. Is the target containing AWSMobileClient in your project Objective-C only?
My project is a mix of ObjC (10%) and Switf (90%). I am using AWSMobileClient in both objC (#import <AWSMobileClient/AWSMobileClient.h>) and swift classes (import AWSMobileClient) I also have a few targets in the project.
x targets for apps - all pods are used in these targets 1 UITest target - all pods are used in this target 2 Notification Service & Content targets -> no pods are added to them
Btw, this swift version thing happens for me with AWSMobileClient, KYDrawerController and Koloda pods.
Indeed there's an issue with the override.
I've been working on an update of PodBuilder for some time now and it should fix the issue as specs are overridden correctly.
"spec_overrides": {
"AWSMobileClient": {
"swift_version": "5.0"
}
}
Is expected to work (actually I just tried).
Beta 5 which can be installed by running gem install pod-builder --pre
, if you try it out let me know how it goes.
It worked for the 2 smaller pods, KYDrawerController and Koloda, gonna try the AWS ones afterwards.
Thanks !
Good to know, there are still a few things to fix but the new version is definitely an improvement over the first iteration
Any idea about my other issue with Firebase ? How can I make sure ALL firebase related pods are NOT prebuilt ? I don't think I want them to, the size is huge and the time to download it (we're using Bitrise) will be longer than to compile them. So I just want all firebase pods to remain as they are. Any idea ? All this while running a build_all, of course.
Did you try setting skip_pods
?
yes, that was the first thing I did. Didn't seem to work.
I have those:
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Performance'
pod 'Firebase/Crashlytics'
And they also install a lot of other dependencies.
Did you check that you're not specifying Firebase in the force_prebuild_pods key? force_prebuild_pods wins over skip_pods. I'm adding a warning for this one
yes, I think I removed it from there, but I'm gonna try today again.
the size is huge and the time to download it (we're using Bitrise) will be longer than to compile them
We probably have slower macs than you have 😅. I our case it's definitely much faster (think about indexing as time as well) than compiling everytime. Of course YMMV.
Got an error again :(
I have this:
"skip_pods": [ "GoogleMaps", "Firebase", "Firebase/Core", "Firebase/Database", "Firebase/Auth", "Firebase/Firestore", "Firebase/Performance", "Firebase/Crashlytics" ], "force_prebuild_pods": [ ],
After a LOT of compiling, I'm still seeing this in the logs:
Installing Firebase (6.27.0) Installing FirebaseABTesting (3.3.0) Installing FirebaseAnalytics (6.6.1) Installing FirebaseAuth (6.6.0) Installing FirebaseCore (6.8.0) Installing FirebaseCoreDiagnostics (1.4.0) Installing FirebaseCrashlytics (4.2.0) Installing FirebaseDatabase (6.3.0) Installing FirebaseFirestore (1.16.0) Installing FirebaseInstallations (1.4.0) Installing FirebasePerformance (3.1.11) Installing FirebaseRemoteConfig (4.6.0)
and when it finally was over, it crashed with this:
Copying 117 frameworks to Rome
Pod installation complete! There are 112 dependencies from the Podfile and 60 total pods installed.
Unable to detect item for framework Protobuf.framework. Please open a bug report!
/Library/Ruby/Gems/2.6.0/gems/pod-builder-2.0.0.beta.5/lib/pod_builder/install.rb:168:in `block in add_framework_plist_info'..........
Can you include the pod entries related to Firebase in your Podfile? Are you using beta 6?
Yes, I wrote these a couple of posts above, this is what I'm using:
pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Database' pod 'Firebase/Auth' pod 'Firebase/Firestore' pod 'Firebase/Performance' pod 'Firebase/Crashlytics'
As for beta, I had 5, installing now 6 and restarting a build_all.
Beta 6 should fix the Unable to detect item for framework
Yes, that error is gone. But still ended up with Firebase built, even if I have this:
"skip_pods": [ "GoogleMaps", "Firebase", "Firebase/Core", "Firebase/Database", "Firebase/Auth", "Firebase/Firestore", "Firebase/Performance", "Firebase/Crashlytics" ], "force_prebuild_pods": [ ],
AND got the warning you mentioned:
[PodBuilder] Removing target support duplicated entries
PodBuilder.json contains 'Firebase' both in force_prebuild_pods
and skip_pods
. Will force prebuilding.
[PodBuilder] Checking target support resource collisions
PodBuilder.json contains 'Firebase' both in force_prebuild_pods
and skip_pods
. Will force prebuilding.
As you can see, it's not in force_prebuild_pods.
Fixed in beta 7
Great ! I'm now in a quite stable phase with all my pods, everything is pre-build except the Firebase stuff, which is kinda too big in size to be usable at this point for me. (Not to mention the run script, that I really don't feel like fixing now) One thing I noticed, although I'm not 100% sure, is that Firebase was indeed skipped now, the Pods are left alone, but I also found frameworks built in my Frameworks folder. I deleted them and everything still worked. So they were either there from before or they were build now but not linked in any way.
I'll keep an eye out for this in the future.
In the meantime, I have a question for you: If I add a target in the future, I should add it in the Frameworks/Podfile now and just run a pod_builder build_all again? Or is there a faster way ?
And adding a new pod in the future... just add it in that same Podfile and do a build
Thanks for all the answers, I'm gonna do a bitrise test now and see how much time this thing saved us. Our previous builds took anywhere between 40 and 60 minutes per target.
In the meantime, I have a question for you: If I add a target in the future, I should add it in the Frameworks/Podfile
Yes. This is the main Podfile, while the other one is autogenerated. Should you ever should change your mind about using PodBuilder you can just take the Frameworks/Podfile, run pod install
and everything will continue to work as expected.
Or is there a faster way ?
Update the Frameworks/Podfile and run pod_builder sync_podfile
, won't rebuild anything as it is not needed.
And adding a new pod in the future
Add the pod in the Frameworks/Podfile and run pod_builder build pod_name
.
Our previous builds took anywhere between 40 and 60 minutes per target.
Let me know how much it took using prebuilt frameworks.
From a total of 35 mins, it got down to ...32. BUT: all the big frameworks I have are not pre build: Firebase and Google stuff. Google has a LOT of other dependencies, tons of C++/auth/etc stuff which takes forever to build. They also use bundle files, so I suppose that's why we're not prebuilding them, right ?
I'm trying to see what I can do about them, but man, their frameworks are just a big pile of ... stuff :)
Also, one thing I'm not sure about, how do you correctly remove a pod ? I commented it in Frameworks/Podfile and run sync_podfile, but something didn't go right... it said Installing GoogleMaps in the logs... and it's still there. (although in the root Podfile, it's now commented out)
From a total of 35 mins, it got down to ...32.
That's well below expectations. In our project using prebuilt frameworks cuts compilation by over 50%.
I commented it in Frameworks/Podfile and run sync_podfile, but something didn't go right...
After running sync_podfile you should see it commented in the autogenerated Podfile as well. Could it be that you commented a dependency which will be automatically installed by cocoapods?
No no, it was a big one, GoogleMaps. Yes, I do see it commented in the autogenerated Pod... but the Pod itself is still there, I saw a "Installing GoogleMaps..." in the log (instead of Removing GoogleMaps....). Weird, before, there were 2 frameworks in that pod: GoogleMaps and GoogleMapsCore. After running sync_pod file... I now have only one of those, the Core one. Very weird, looks like the remove doesn't work correctly.
Also, about compiliation time, it's OK, I checked some bitrise logs, before and after and indeed the pods I prebuilt were only taking that long. The big culprits are Firebase and a lot of Google stuff (mostly dependencies that I can't control)
even if you manually run pod install?
Weirdly, no. Here's what I did:
pod_builder sync_podfile
Updating local specs repositories
$ /usr/bin/git -C /Users/xxx/.cocoapods/repos/cocoapods fetch origin --progress
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 36 (delta 23), reused 0 (delta 0), pack-reused 0
From https://github.com/CocoaPods/Specs
f73c7743824f..cd52e9f503a4 master -> origin/master
$ /usr/bin/git -C /Users/xxx/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/xxx/.cocoapods/repos/cocoapods reset --hard origin/master
HEAD is now at cd52e9f503a4 [Add] TestStagg 0.0.11
Analyzing dependencies
Pre-downloading: JSQMessagesViewController
from https://github.com/xxx/JSQMessagesViewController.git
Updating Application Podfile
Writing licenses
Analyzing dependencies
Downloading dependencies
Installing GoogleMaps 3.8.0
Generating Pods project
[PodBuilder] Removing target support duplicated entries
[PodBuilder] Checking target support resource collisions
Integrating client project
Pod installation complete! There are 42 dependencies from the Podfile and 68 total pods installed.
xxx@iMac ~/Documents/Projects/iOS/xxx/xxx
(tmp/4.0.69)*(aws:prod-eu)$ pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
[PodBuilder] Removing target support duplicated entries
[PodBuilder] Checking target support resource collisions
Integrating client project
Pod installation complete! There are 42 dependencies from the Podfile and 68 total pods installed.
So... the sync command triggered an "Installing..." and the pod install didn't do anything. Both Podfiles have: #pod 'GoogleMaps', '~> 3.8.0' (commented out)
Hmmm, how do I get rid of that pod ? :)
Check that there are no leftover entries. This is no longer a PodBuilder issue since pod install
is still installing it.
I think you're right, although I commented the GoogleMaps pod, its Core might be a dependency of GooglePlaces or whatever other pod.
let me ask you one last question :)
Is it possible in any way to pre-build the dependencies that some pods install ?
as you can see here, for a few google and firebase pods, I end up with tons of other dependencies.
Yes you can.
Just explicitly add the pod entries for each dependency and add them to the Frameworks/Podfile
You could for example prebuild nanopb.
target 'MyTarget' do
pod 'Firebase'
pod 'nanopb'
end
I can also confirm that all firebase pods are also prebuilt and found in Frameworks after a build_all, even if they are in skip_pods. They can be deleted, since the source code is not removed from Pods and it works from there.
Unfortunately, prebuilding the dependencies doesn't really work for Firebase. In the "nanopb" case, it's built correctly, but Firebase has some includes and imports that no longer find the files and of course, I can't (shouldn't) modify the firebase base code.
I can't seem to get rid of this error, although it's documented and there is a solution for it, it just doesn't work for me.
Even with this:
"spec_overrides": { "AWSMobileClient": { "swift_version": "4.2" } }
4.2, 5.0, doesn't matter. Doing a build_all always shows the same standard error:
AWSMobileClient
does not specify a Swift version and none of the targets (DummyTarget
) integrating it have theSWIFT_VERSION
attribute set. Please contact the author or set theSWIFT_VERSION
attribute in at least one of the targets that integrate this pod.Since I obviously can't contact the author, what else can I do ? (This also happens to 2 more pods that I have).
I even did this in the preinstall phase in the Podfile:
installer.pods_project.targets.each do |target| case target.name when 'AWSMobileClient' target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4.2' end end end
Still, no luck.
Any ideas ?
Also, I can do the build_all if I put AWSMobileClient in the skip_pods section, but then this Pod is nowhere to be found in the end and I cant build the project.
Any way to deal with the AWS pods or I just have to skip all of them ?