googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.55k stars 2.93k forks source link

[Bug report] GoogleMLKit/Translate problem with firebase pods #584

Closed James-Knipe closed 1 year ago

James-Knipe commented 1 year ago

Adding ANY 2 of the following pods to a new swift project created in Xcode will produce a valid build.

pod 'FirebaseFirestore' pod 'FirebaseFirestoreSwift' pod 'GoogleMLKit/Translate', '3.2.0'

When adding ALL 3 pods I will receive some warnings in the terminal and the project build will fail:

[!] Unable to read the license file `LICENSE` for the spec `GoogleUtilities (7.8.0)`

[!] [Xcodeproj] Generated duplicate UUIDs:

PBXFileReference -- Pods.xcodeproj/mainGroup/children/children:children:|,|,|,displayName:BoringSSL-GRPC,isa:PBXGroup,name:BoringSSL-GRPC,path:BoringSSL-GRPC,sourceTree:<group>,,children:|,|,displayName:FirebaseAnalytics,isa:PBXGroup,name:FirebaseAnalytics,path:FirebaseAnalytics,sourceTree:<group>,,children:|,|,displayName:FirebaseAuth,isa:PBXGroup,name:FirebaseAuth,path:FirebaseAuth,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCore,isa:PBXGroup,name:FirebaseCore,path:FirebaseCore,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCoreExtension,isa:PBXGroup,name:FirebaseCoreExtension,path:FirebaseCoreExtension,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCoreInternal,isa:PBXGroup,name:FirebaseCoreInternal,path:FirebaseCoreInternal,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseFirestore,isa:PBXGroup,name:FirebaseFirestore,path:FirebaseFirestore,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseFirestoreSwift,isa:PBXGroup,name:FirebaseFirestoreSwift,path:FirebaseFirestoreSwift,sourceTree:<group>,,children:|,|,displayName:FirebaseInstanceID,isa:PBXGroup,name:FirebaseInstanceID,path:FirebaseInstanceID,sourceTree:<group>,,children:|,|,|,displayName:FirebaseSharedSwift,isa:PBXGroup,name:FirebaseSharedSwift,path:FirebaseSharedSwift,sourceTree:<group>,,children:|,|,displayName:FirebaseStorage,isa:PBXGroup,name:FirebaseStorage,path:FirebaseStorage,sourceTree:<group>,,children:|,|,displayName:GTMSessionFetcher,isa:PBXGroup,name:GTMSessionFetcher,path:GTMSessionFetcher,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:GoogleDataTransport,isa:PBXGroup,name:GoogleDataTransport,path:GoogleDataTransport,sourceTree:<group>,,children:|,|,displayName:GoogleInterchangeUtilities,isa:PBXGroup,name:GoogleInterchangeUtilities,path:GoogleInterchangeUtilities,sourceTree:<group>,,children:|,|,displayName:GoogleMLKit,isa:PBXGroup,name:GoogleMLKit,path:GoogleMLKit,sourceTree:<group>,,children:|,|,displayName:GoogleSymbolUtilities,isa:PBXGroup,name:GoogleSymbolUtilities,path:GoogleSymbolUtilities,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,displayName:GoogleToolboxForMac,isa:PBXGroup,name:GoogleToolboxForMac,path:GoogleToolboxForMac,sourceTree:<group>,,children:|,|,displayName:GoogleUtilities,isa:PBXGroup,name:GoogleUtilities,path:GoogleUtilities,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,displayName:GoogleUtilitiesComponents,isa:PBXGroup,name:GoogleUtilitiesComponents,path:GoogleUtilitiesComponents,sourceTree:<group>,,children:|,|,|,displayName:Libuv-gRPC,isa:PBXGroup,name:Libuv-gRPC,path:Libuv-gRPC,sourceTree:<group>,,children:|,|,displayName:MLKitCommon,isa:PBXGroup,name:MLKitCommon,path:MLKitCommon,sourceTree:<group>,,children:|,|,displayName:MLKitNaturalLanguage,isa:PBXGroup,name:MLKitNaturalLanguage,path:MLKitNaturalLanguage,sourceTree:<group>,,children:|,|,|,displayName:MLKitTranslate,isa:PBXGroup,name:MLKitTranslate,path:MLKitTranslate,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:PromisesObjC,isa:PBXGroup,name:PromisesObjC,path:PromisesObjC,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:Protobuf,isa:PBXGroup,name:Protobuf,path:Protobuf,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:SSZipArchive,isa:PBXGroup,name:SSZipArchive,path:SSZipArchive,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:abseil,isa:PBXGroup,name:abseil,path:abseil,sourceTree:<group>,,children:|,|,|,|,displayName:gRPC-C++,isa:PBXGroup,name:gRPC-C++,path:gRPC-C++,sourceTree:<group>,,children:|,|,|,displayName:gRPC-Core,isa:PBXGroup,name:gRPC-Core,path:gRPC-Core,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:leveldb-library,isa:PBXGroup,name:leveldb-library,path:leveldb-library,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,displayName:nanopb,isa:PBXGroup,name:nanopb,path:nanopb,sourceTree:<group>,,displayName:Pods,isa:PBXGroup,name:Pods,sourceTree:<group>,/Pods/children/children:children:|,displayName:Frameworks,isa:PBXGroup,name:Frameworks,sourceTree:<group>,,children:|,|,|,|,displayName:Support Files,isa:PBXGroup,name:Support Files,path:../Target Support Files/GoogleUtilities,sourceTree:<group>,,displayName:GoogleUtilities,isa:PBXGroup,name:GoogleUtilities,path:GoogleUtilities,sourceTree:<group>,/Pods/GoogleUtilities/children/children:displayName:GoogleUtilities.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.debug.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.release.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.release.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.debug.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.release.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.release.xcconfig,sourceTree:<group>,,displayName:Support Files,isa:PBXGroup,name:Support Files,path:../Target Support Files/GoogleUtilities,sourceTree:<group>,/Pods/GoogleUtilities/Support Files/children/displayName:GoogleUtilities.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.debug.xcconfig,sourceTree:<group>,/Pods/GoogleUtilities/Support Files/GoogleUtilities.debug.xcconfig
PBXFileReference -- Pods.xcodeproj/mainGroup/children/children:children:|,|,|,displayName:BoringSSL-GRPC,isa:PBXGroup,name:BoringSSL-GRPC,path:BoringSSL-GRPC,sourceTree:<group>,,children:|,|,displayName:FirebaseAnalytics,isa:PBXGroup,name:FirebaseAnalytics,path:FirebaseAnalytics,sourceTree:<group>,,children:|,|,displayName:FirebaseAuth,isa:PBXGroup,name:FirebaseAuth,path:FirebaseAuth,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCore,isa:PBXGroup,name:FirebaseCore,path:FirebaseCore,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCoreExtension,isa:PBXGroup,name:FirebaseCoreExtension,path:FirebaseCoreExtension,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseCoreInternal,isa:PBXGroup,name:FirebaseCoreInternal,path:FirebaseCoreInternal,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseFirestore,isa:PBXGroup,name:FirebaseFirestore,path:FirebaseFirestore,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:FirebaseFirestoreSwift,isa:PBXGroup,name:FirebaseFirestoreSwift,path:FirebaseFirestoreSwift,sourceTree:<group>,,children:|,|,displayName:FirebaseInstanceID,isa:PBXGroup,name:FirebaseInstanceID,path:FirebaseInstanceID,sourceTree:<group>,,children:|,|,|,displayName:FirebaseSharedSwift,isa:PBXGroup,name:FirebaseSharedSwift,path:FirebaseSharedSwift,sourceTree:<group>,,children:|,|,displayName:FirebaseStorage,isa:PBXGroup,name:FirebaseStorage,path:FirebaseStorage,sourceTree:<group>,,children:|,|,displayName:GTMSessionFetcher,isa:PBXGroup,name:GTMSessionFetcher,path:GTMSessionFetcher,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:GoogleDataTransport,isa:PBXGroup,name:GoogleDataTransport,path:GoogleDataTransport,sourceTree:<group>,,children:|,|,displayName:GoogleInterchangeUtilities,isa:PBXGroup,name:GoogleInterchangeUtilities,path:GoogleInterchangeUtilities,sourceTree:<group>,,children:|,|,displayName:GoogleMLKit,isa:PBXGroup,name:GoogleMLKit,path:GoogleMLKit,sourceTree:<group>,,children:|,|,displayName:GoogleSymbolUtilities,isa:PBXGroup,name:GoogleSymbolUtilities,path:GoogleSymbolUtilities,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,displayName:GoogleToolboxForMac,isa:PBXGroup,name:GoogleToolboxForMac,path:GoogleToolboxForMac,sourceTree:<group>,,children:|,|,displayName:GoogleUtilities,isa:PBXGroup,name:GoogleUtilities,path:GoogleUtilities,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,displayName:GoogleUtilitiesComponents,isa:PBXGroup,name:GoogleUtilitiesComponents,path:GoogleUtilitiesComponents,sourceTree:<group>,,children:|,|,|,displayName:Libuv-gRPC,isa:PBXGroup,name:Libuv-gRPC,path:Libuv-gRPC,sourceTree:<group>,,children:|,|,displayName:MLKitCommon,isa:PBXGroup,name:MLKitCommon,path:MLKitCommon,sourceTree:<group>,,children:|,|,displayName:MLKitNaturalLanguage,isa:PBXGroup,name:MLKitNaturalLanguage,path:MLKitNaturalLanguage,sourceTree:<group>,,children:|,|,|,displayName:MLKitTranslate,isa:PBXGroup,name:MLKitTranslate,path:MLKitTranslate,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:PromisesObjC,isa:PBXGroup,name:PromisesObjC,path:PromisesObjC,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:Protobuf,isa:PBXGroup,name:Protobuf,path:Protobuf,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:SSZipArchive,isa:PBXGroup,name:SSZipArchive,path:SSZipArchive,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:abseil,isa:PBXGroup,name:abseil,path:abseil,sourceTree:<group>,,children:|,|,|,|,displayName:gRPC-C++,isa:PBXGroup,name:gRPC-C++,path:gRPC-C++,sourceTree:<group>,,children:|,|,|,displayName:gRPC-Core,isa:PBXGroup,name:gRPC-Core,path:gRPC-Core,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,displayName:leveldb-library,isa:PBXGroup,name:leveldb-library,path:leveldb-library,sourceTree:<group>,,children:|,|,|,|,|,|,|,|,|,|,displayName:nanopb,isa:PBXGroup,name:nanopb,path:nanopb,sourceTree:<group>,,displayName:Pods,isa:PBXGroup,name:Pods,sourceTree:<group>,/Pods/children/children:children:|,displayName:Frameworks,isa:PBXGroup,name:Frameworks,sourceTree:<group>,,children:|,|,|,|,displayName:Support Files,isa:PBXGroup,name:Support Files,path:../Target Support Files/GoogleUtilities,sourceTree:<group>,,displayName:GoogleUtilities,isa:PBXGroup,name:GoogleUtilities,path:GoogleUtilities,sourceTree:<group>,/Pods/GoogleUtilities/children/children:displayName:GoogleUtilities.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.debug.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.release.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.release.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.debug.xcconfig,sourceTree:<group>,,displayName:GoogleUtilities.release.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.release.xcconfig,sourceTree:<group>,,displayName:Support Files,isa:PBXGroup,name:Support Files,path:../Target Support Files/GoogleUtilities,sourceTree:<group>,/Pods/GoogleUtilities/Support Files/children/displayName:GoogleUtilities.release.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:GoogleUtilities.release.xcconfig,sourceTree:<group>,/Pods/GoogleUtilities/Support Files/GoogleUtilities.release.xcconfig

[!] [Xcodeproj] Generated duplicate UUIDs:

PBXAggregateTarget -- 8D7F5D5DD528D21A72DC87ADA5B12E2D

The build error:

(path_to_my_app)/Pods/GoogleUtilitiesComponents/GoogleUtilitiesComponents/Sources/GULCCComponentContainer.m:22:9 'GoogleUtilities/GULLogger.h' file not found

To Reproduce Create a new swift project in Xcode

Add ANY 2 of these pods and the project will build:

pod 'FirebaseStorage' pod 'FirebaseFirestoreSwift' pod 'GoogleMLKit/Translate', '3.2.0'

Adding the third pod will produce the build error.

So FirebaseStorage + FirebaseFirestoreSwift = BUILD FirebaseStorage + GoogleMLKit/Translate = BUILD FirebaseFirestoreSwift + GoogleMLKit/Translate = BUILD FirebaseStorage + FirebaseFirestoreSwif + GoogleMLKit/Translate = BUILD FAIL

PODFILE:

use_frameworks!

platform :ios, '11.0'

project 'TranslateExample.xcodeproj'

 pod 'FirebaseStorage'
 pod 'GoogleMLKit/Translate', '3.2.0'
 pod 'FirebaseFirestoreSwift'

end

EDIT: - I tried the depreciated 'FirebaseMLNLTranslate' in place of 'GoogleMLKit/Translate' and there is no build error. App builds, runs and translates.

How can I get the current GoogleMLKit/Translate working with both firebase pods as it does install and build when in conjunction with a single firebase pod?

SDK Info:

pod 'FirebaseStorage' pod 'GoogleMLKit/Translate', '3.2.0' pod 'FirebaseFirestoreSwift'

Smartphone: iPhone 11 iOS 16.0.2, iPad Air2 iOS 15.7

Development Environment:

James-Knipe commented 1 year ago

not solved but a workaround is here: https://stackoverflow.com/questions/74412744/googleutilities-gulloggerlevel-h-file-not-found-when-using-firebase-and-mlki?noredirect=1#74422404