Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Unexpected duplicate tasks - Build error when AppboyKit integrated through SPM #261

Closed bharathnagarajrao closed 3 years ago

bharathnagarajrao commented 3 years ago

Report

Describe your environment.

Info Value
Platform Name iOS
Platform Version 14.0
SDK Version 3.29.1
Integration Method Swift Package Manager (SPM)
Xcode Version e.g. Xcode 12.0 (12A7209)
Repro rate all the time (100%)

What did you do?

I forked Appboy repo into our enterprise Github & tried adding it as dependency through Swift Package Manager pointing to the commit Id 75647ca863868b46fe4015124456381b58ac491a

appboy

If I build the project, i am seeing this build error

Unexpected duplicate tasks:
1) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'
2) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'

What did you expect to happen?

Build Appboy through SPM

What happened instead?

Unexpected duplicate tasks:
1) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'
2) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'

Steps to reproduce

Add Appboy as dependency through Swift Package Manager pointing to the commit Id 75647ca863868b46fe4015124456381b58ac491a

appboy

Code Snippet

None

Are you doing any feature customizations that may relate to the issue? Can you share the code snippet?

No

Project that demonstrates the issue

It's internally hosted

lowip commented 3 years ago

Hi @bharathnagarajrao,

Could you verify that you included only either AppboyKit or AppboyUI. AppboyUI already includes AppboyKit and so it is not necessary to include both in your project.

bharathnagarajrao commented 3 years ago

Hi @lowip, I followed the instructions from Braze documentation

Make sure you select either AppboyKit or AppboyUI. Including both packages can lead to undesired behavior.

When it prompted with AppboyKit(static library) & AppboyUI, I chose AppboyKit

hokstuff commented 3 years ago

Hi @bharathnagarajrao,

It appears that the duplicate tasks are the same exact commands from the the same paths. Can you delete the local Appboy-iOS-SDK files thru SPM and try again? If that doesn't work, try to clean build folder / delete DerivedData and see if that helps.

If you are still having issues, please email support@braze.com to get further assistance - thank you!

hokstuff commented 3 years ago

Just checking if you are still experiencing issues @bharathnagarajrao?

bharathnagarajrao commented 3 years ago

@hokstuff Thanks for following up. I haven't had chance to get back on this. I switched to carthage for our integration. We can close this issue for now.

hokstuff commented 3 years ago

Thanks, I'll close this out - feel free to reopen if you run into the same issue in the future.

bharathnagarajrao commented 3 years ago

Hi @hokstuff, I tried to migrate our Braze integration from carthage to SPM using the version 4.3.0 and ended up seeing the same error which was mentioned earlier. ie,

Unexpected duplicate tasks:
1) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'
2) Target 'MyProject' (project 'MyProject') has copy command from '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework/ios-arm64_i386_x86_64-simulator/libAppboyKitLibrary.a' to '/Users/abcd/Library/Developer/Xcode/DerivedData/MyProject-gabocuueqjhikmfwifcdmskcjmzw/Build/Products/Debug-iphonesimulator/MyProject.framework/Frameworks/libAppboyKitLibrary.a'

Appreciate any help on this.

lowip commented 3 years ago

Hi @bharathnagarajrao,

Could you send us the full Xcode build logs at support@braze.com.

You can retrieve the logs by selecting the export button in Xcode: jrYXi

Thanks,