yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7.01k stars 818 forks source link

XCodegen is not detecting some downloaded Pods #1375

Open pedroramos1449 opened 1 year ago

pedroramos1449 commented 1 year ago

Hello! How you guys doing?

I converted my whole project to XCodegen.

My project has multiple modules and all the libraries are downloaded via Cocoapods.

But, I've got a problem on the SharedFrontend module. In this module (Sharedfrontend) I import "Tracker" which from ATInternet-Apple-SDK, but Xcode or project doesn't detect it, and give me a error saying: "No Such Module Tracker", BUT It has the Tracker on the pods, and it did download it...

That leads me think ( I can be wrong ) that the problem are the pods not being recognised on SharedFrontend, which is why I am here today :)

My SharedFrontend .YML file:

> name: SharedFrontend
> options:
>   minimumXcodeGenVersion: 2.25
>   groupSortPosition: top
>   generateEmptyDirectories: true
>   deploymentTarget:
>     iOS: "12.3"
> targets:
>   SharedFrontend:
>     type: framework
>     platform: iOS
>     settings:
>       PRODUCT_BUNDLE_IDENTIFIER: "pt.custojusto.SharedFrontend"
>       GENERATE_INFOPLIST_FILE: YES
>     scheme:
>       gatherCoverageData: true
>     sources:
>       - path: SharedFrontend
>         createIntermediateGroups: true
> 
>   SharedFrontendTests:
>     type: bundle.unit-test
>     platform: iOS
>     sources:
>       - path: SharedFrontendTests
>         createIntermediateGroups: true
>     dependencies:
>       - target: SharedFrontendTests

Plus, above, a image of the Sharedfrontend module, wich you can see the pods are there:

Plus, I've made a Script to run pod install every time xcodegen updates, which I think does not have anything to do with my problem itself, but can be helpful.

> #!/bin/bash
> cd cj-ios
> xcodegen
> cd ..
> cd cj-pro/iosApp
> xcodegen
> cd ../..
> cd cj-uicomponents/iOS/UIComponents
> xcodegen
> cd ../../../
> cd cj-sharedfrontend/SharedFrontend
> xcodegen
> cd ../../
> pod install

I hope you guys could help me, our give any hint. I am looking to this for a week now, and I didn't get any solution yet..

Really Thanks!

Peter

Lutzifer commented 1 year ago

I think your pod file would be necessary to get to the source of the bug

pedroramos1449 commented 1 year ago

Yes Ofcourse, I am sorry.

Here it is @Lutzifer

(..links)
platform :ios, '12.3'

workspace 'CustoJusto.xcworkspace'

use_frameworks!
use_modular_headers!

project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
project 'cj-pro/iosApp/Account/Account.xcodeproj'
project 'cj-pro/iosApp/AdInsertion/AdInsertion.xcodeproj'
project 'cj-pro/iosApp/Authentication/Authentication.xcodeproj'
project 'cj-pro/iosApp/BuyOptions/BuyOptions.xcodeproj'
project 'cj-pro/iosApp/Dashboard/Dashboard.xcodeproj'
project 'cj-pro/iosApp/Messaging/Messaging.xcodeproj'
project 'cj-pro/iosApp/MyAds/MyAds.xcodeproj'
project 'cj-sharedfrontend/SharedFrontend/SharedFrontend.xcodeproj'
project 'cj-ios/CustoJusto.xcodeproj'
project 'cj-uicomponents/iOS/UIComponents/UIComponents.xcodeproj'

def messaging
  pod 'MessagingUIViews/Core', '~> 20.20.0'
  pod 'Knocker', '9.2.0'
end

def firebase
  pod 'Firebase/Core'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Analytics'
  pod 'Firebase/RemoteConfig'
end

def common
  pod 'ATInternet-Apple-SDK/Tracker','>=2.0'
  pod 'RxSwift','6.1.0'
  pod 'RxCocoa','6.1.0'
  pod 'configurator-ios', '0.1.6'
  pod 'Google-Mobile-Ads-SDK','~> 9.0.0'
  pod 'GoogleUtilities'
  pod 'SwiftyGif'
  pod "PianoAnalytics/iOS", ">=3.0"
end

target 'CustoJustoPro' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'Account' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'AdInsertion' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'Authentication' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'BuyOptions' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'Dashboard' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'Messaging' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'MyAds' do
  project 'cj-pro/iosApp/CustoJustoPro.xcodeproj'
  common
  firebase
  messaging
end

target 'SharedFrontend' do
  project 'cj-sharedfrontend/SharedFrontend/SharedFrontend.xcodeproj'
  common
  firebase
  messaging
end

target 'CustoJusto' do
  project 'cj-ios/CustoJusto.xcodeproj'
  pod 'Eureka','5.3.4'
  common
  firebase
  messaging
end

target 'CoreCustoJusto' do
  project 'cj-ios/CustoJusto.xcodeproj'
  common
  messaging
  firebase
end

target 'CoreCustoJustoTests' do
  project 'cj-ios/CustoJusto.xcodeproj'
  pod 'Eureka','5.3.4'
  pod 'RxBlocking','6.1.0'
  pod 'RxTest','6.1.0'
  firebase
  common
  messaging
end

target 'CustoJustoUITests' do
  project 'cj-ios/CustoJusto.xcodeproj'
  pod 'Eureka','5.3.4'
  pod 'RxBlocking','6.1.0'
  pod 'RxTest','6.1.0'
  firebase
  common
  messaging
end

target 'UIComponents' do
  project 'cj-uicomponents/iOS/UIComponents/UIComponents.xcodeproj'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.3'
    end
  end
end

`

Lutzifer commented 1 year ago

One thing you can try is to not do separate projects, but one big project with several targets, I guess this best matches what Cocoapods is aimed at.

pedroramos1449 commented 1 year ago

I use kotlin Multi Platform, and Shared modules, that's why It's everything separated :) But I will try

fadhln commented 1 year ago

Hi @pedroramos1449 do you find any resolution to this issue?

pedroramos1449 commented 1 year ago

Hello, Still not :(