amplify-swift icon indicating copy to clipboard operation
amplify-swift copied to clipboard

Errors when amplify is installed along with OneSignal on Archive

Open dpalme3160 opened this issue 3 years ago • 7 comments

Describe the bug

When adding amplify to an existing ios app that has OneSignal and Purchases installed, the archive process fails every time.

It will build successfully at times but it will never archive.

Steps To Reproduce

An app has as installed base of OneSignal via a Swift Package.  The app operates correctly and will build as well as archive successfully.

[DETAILS]
Xcode Version: 13.4.1

The following packages are installed as swift packages:
Purchases (Version 3.11.1 or newer)
OneSignalXCFramework (Version 3.0.0 - 4.0.0)

Amplify is that installed as a Swift Package: https://github.com/aws-amplify/amplify-ios

The following plugins were selected:
AWSAPIPlugin
AWSCognitoAuthPlugin
AWSDataStorePlugin
AWSPinpointAnalyticsPlugin
AWSS3StorePlugin
Amplify

App is closed and Amplify init is initiated

Default app name 
Dev environment
Xcode
Ios
default profile selected

Successfully shows initialization in the cloud
Updating Xcode project:
-- Amplify project found.
-- Amplify config files found.
-- Successfully updated project /Users/xxx/Programming-new/xxx/xxx.
Amplify setup completed successfully.
xxx@MBP20220425 xxx % 

Reopen project
Allow to finish indexing

Build with iPhone 12 simulator
Project builds successfully 

Import Amplify in AppDelegate
Add initialization to bottom of didFinishLaunching 
do {
        try Amplify.configure()
    } catch {
        print("An error occurred setting up Amplify: \(error)")
    }
return true

Still builds successfully

amplify add Analytics
Selected Pinpoint
Allow guests? Yes
Amplify push

Updated the do loop with the following:
       do {
           try Amplify.add(plugin: AWSCognitoAuthPlugin())
           try Amplify.add(plugin: AWSPinpointAnalyticsPlugin())
           try Amplify.configure()
           print("Amplify configured with Auth and Analytics plugins")
           } catch {
               print("An error occurred setting up Amplify: \(error)")
           }

Still builds successfully, but when I now try to archive it blows up.

See error message:
No such module OneSignal
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target 'PurchasesCoreSwift' from project 'Purchases')
    cd /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/SourcePackages/checkouts/purchases-ios
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name PurchasesCoreSwift -O -whole-module-optimization -enforce-exclusivity\=checked @/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/Objects-normal/armv7/PurchasesCoreSwift.SwiftFileList -DSWIFT_PACKAGE -DXcode -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -target armv7-apple-ios9.0 -g -module-cache-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -embed-bitcode -swift-version 5 -I /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk/Developer/Library/Frameworks -c -num-threads 10 -output-file-map /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/Objects-normal/armv7/PurchasesCoreSwift-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/Objects-normal/armv7/PurchasesCoreSwift.swiftmodule -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/swift-overrides.hmap -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos/include -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/DerivedSources-normal/armv7 -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/DerivedSources/armv7 -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/DerivedSources -Xcc -DSWIFT_PACKAGE -emit-objc-header -emit-objc-header-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Purchases.build/Release-iphoneos/PurchasesCoreSwift.build/Objects-normal/armv7/PurchasesCoreSwift-Swift.h -working-directory /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/SourcePackages/checkouts/purchases-ios

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
Command CompileSwiftSources failed with a nonzero



CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Amplify' from project 'Amplify')
    cd /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/SourcePackages/checkouts/amplify-ios
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Amplify -O -whole-module-optimization -enforce-exclusivity\=checked @/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/Objects-normal/arm64/Amplify.SwiftFileList -DSWIFT_PACKAGE -DXcode -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk -target arm64-apple-ios11.0 -g -module-cache-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -embed-bitcode -swift-version 5 -I /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk/Developer/Library/Frameworks -c -num-threads 10 -output-file-map /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/Objects-normal/arm64/Amplify-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/Objects-normal/arm64/Amplify.swiftmodule -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/swift-overrides.hmap -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/BuildProductsPath/Release-iphoneos/include -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/DerivedSources-normal/arm64 -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/DerivedSources/arm64 -Xcc -I/Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/DerivedSources -Xcc -DSWIFT_PACKAGE -emit-objc-header -emit-objc-header-path /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/Build/Intermediates.noindex/ArchiveIntermediates/Bible/IntermediateBuildFilesPath/Amplify.build/Release-iphoneos/Amplify.build/Objects-normal/arm64/Amplify-Swift.h -working-directory /Users/douglaspalme/Library/Developer/Xcode/DerivedData/Bible-aqpjquhqwqeiunawwbehrbhkzlin/SourcePackages/checkouts/amplify-ios

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
Command CompileSwiftSources failed with a nonzero exit code

Expected behavior

I would expect it to archive successfully

Amplify Framework Version

9.1.0

Amplify Categories

Analytics, API, Auth, DataStore, Storage

Dependency manager

Cocoapods

Swift version

5

CLI version

9.1.0

Xcode version

13.4.1

Relevant log output

N/A

Is this a regression?

No

Regression additional context

N/A

Device

iPhone 11 simulator / iPhone 12 simulator

iOS Version

12.4

Specific to simulators

N/A

Additional context

N/A

dpalme3160 avatar Jul 13 '22 17:07 dpalme3160

Thanks for opening this issue @dpalme3160. The error message displayed (No such module OneSignal) indicates that there is an issue with the OneSignal module. According to your notes, you're only experiencing this after adding Amplify via SPM. I'll try to reproduce it on my end and let you know what I find.

atierian avatar Jul 22 '22 17:07 atierian

Ian, Thanks for the response and I’m looking forward to your findings.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Ian Saultz @.> Sent: Friday, July 22, 2022 12:06:48 PM To: aws-amplify/amplify-ios @.> Cc: Douglas Palme @.>; Mention @.> Subject: Re: [aws-amplify/amplify-ios] Errors when amplify is installed along with OneSignal on Archive (Issue #1999)

Thanks for opening this issue @dpalme3160https://github.com/dpalme3160. The error message displayed (No such module OneSignal) indicates that there is an issue with the OneSignal module. According to your notes, you're only experiencing this after adding Amplify via SPM. I'll try to reproduce it on my end and let you know what I find.

— Reply to this email directly, view it on GitHubhttps://github.com/aws-amplify/amplify-ios/issues/1999#issuecomment-1192774127, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG4QTPAWVZYVPLPHPZEFOM3VVLIKRANCNFSM53PRCFXA. You are receiving this because you were mentioned.Message ID: @.***>

dpalme3160 avatar Jul 22 '22 17:07 dpalme3160

I'm missing a few details that will help me debug this. Can you please answer the questions below:

  • What version of Amplify iOS are you using? You can find this in the project navigator under the Package Dependencies section, next to Amplify.
  • Please link the GitHub repo for Purchases package you're using.
  • What targets are you adding from the Purchases and OneSignalXCFramework packages?
  • The error you're experiencing when archiving, does that occur when you archive or while uploading after you archive?
  • Just to confirm, you're using SPM for all of these packages as you wrote in the Steps to Reproduce section and not Cocoapods as you wrote under Dependency Manager?

Thanks.

atierian avatar Jul 22 '22 18:07 atierian

  • 1.0.0 is what is installed via the SPM.

  • https://github.com/RevenueCat/purchases-ios.git

  • Purchases has no actual target.

  • Onesignal target, we have also tried adding it via a cocoapod and both still throw the same errors. The target created as a part of OneSignal: OneSignalNotificationServiceExtension

  • The error is generated during the archive process not during the upload.

We have used SPM for all except OneSignal in which we have used both the SPM as well as the CocoaPod version.

dpalme3160 avatar Jul 23 '22 17:07 dpalme3160

Are you still experiencing this issue @dpalme3160? I haven't been able to reproduce it based on the information provided.

atierian avatar Sep 30 '22 19:09 atierian

Yes

Get Outlook for iOShttps://aka.ms/o0ukef


From: Ian Saultz @.> Sent: Friday, September 30, 2022 2:01:27 PM To: aws-amplify/amplify-ios @.> Cc: Douglas Palme @.>; Mention @.> Subject: Re: [aws-amplify/amplify-ios] Errors when amplify is installed along with OneSignal on Archive (Issue #1999)

Are you still experiencing this issue @dpalme3160https://github.com/dpalme3160? I haven't been able to reproduce it based on the information provided.

— Reply to this email directly, view it on GitHubhttps://github.com/aws-amplify/amplify-ios/issues/1999#issuecomment-1263916691, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG4QTPGNGSUGVWFYHYOX7D3WA42IPANCNFSM53PRCFXA. You are receiving this because you were mentioned.Message ID: @.***>

dpalme3160 avatar Sep 30 '22 22:09 dpalme3160

Sorry to hear that. As I mentioned above, I'm not able to reproduce this based on the information in the issue. But I'd like to help you resolve this - are you able to provide an example project that reproduces this issue?

atierian avatar Oct 03 '22 17:10 atierian