0

I have a Solar2D app (native, so it connects to and runs Objective-C and Swift modules) and I want to add in a module that is available in CocoaPods (SwiftAudioPlayer). Although an experienced programmer, I am not fluent using Xcode, and have done only a few small projects.

After running pod install and restarting my app as instructed, I first encountered:

  1. the 'sync' error [fixed this, see first comment]
  2. "Target Support Files/Pods-SoundScape/Pods-SoundScape.debug.xcconfig or include the Target Support Files/Pods-SoundScape/Pods-SoundScape.debug.xcconfig in your build configuration (CoronaApp.xcconfig)" [fixed, see second comment]

For the sync error, several forum suggestions say to add user-defined PODS_ROOT and PODS_PODFILE_DIR_PATH (and other things I tried with no effect). This gets rid of the error, but creates a new problem, pod_install suggests: - Use the $(inherited) flag, or - Remove the build settings from the target. Well, the second just puts me back to where I started with the sync error, and the first does not change anything.

For problem 2, the link to the xconfig, I cannot find any link that works, that finds that file, even an explicit disk path to the file. Always 'included file does not exist'.

Perhaps not surprisingly, building the project results in: Library 'Pods-SoundScape' not found

And, of course, import SwiftAudioPlayer in a Swift player gives me "no such module".

Here is what the project looks like

3
  • I got rid of the sync problem with the change suggested in another thread: 137 After many attemps I managed to fix this problem. Variable ${PODS_ROOT} was not set and I do below trick. Go to Build Phases -> Check Pods Manifest.lock and replace diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null to diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null Commented May 5, 2024 at 5:45
  • I managed to get the include of Pods-SoundScape.debug.xcconfig to work, but of course now a new error: /Users/davidmarques/Library/Developer/Xcode/DerivedData/SoundScape-djytmyjktdabszdevvureyguzznz/Build/Intermediates.noindex/SoundScape.build/Debug-iphonesimulator/SoundScape.build/DerivedSources/GeneratedAssetSymbols.swift Module map file '/Users/davidmarques/Library/Developer/Xcode/DerivedData/SoundScape-djytmyjktdabszdevvureyguzznz/Build/Products/Debug-iphonesimulator/SwiftAudioPlayer/SwiftAudioPlayer.modulemap' not found I have no idea what that means, why that error. Commented May 5, 2024 at 7:20
  • SwiftAudioPlayer.modulemap does exist, in the subdirectory Pods/SwiftAudioPlayer/Support Files Commented May 5, 2024 at 7:35

1 Answer 1

0

So I did fix those two problems as indicated in my comments. But they just opened a new one, and I don't know where to start.

Module map file '/Users/davidmarques/Library/Developer/Xcode/DerivedData/SoundScape-.../Build/Products/Debug-iphonesimulator/SwiftAudioPlayer/SwiftAudioPlayer.modulemap' not found

That looks like Xcode is looking in very much the wrong place. SwiftAudioPlayer.modulemap is there, in the project. So maybe this line in Pods-SoundScape.debug.xconfig is wrong: OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/SwiftAudioPlayer/SwiftAudioPlayer.modulemap"?

Edit that file? (this does change the error message, so maybe the right track?) Override that flag set by pods install? Again, indicates something wrong with pods install in my configuration.

Well, the beat goes on. Putting in literal disk path did work, just moved on to the next error:

Library 'SwiftAudioPlayer' not found

And so far, editing the relevant line:

LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftAudioPlayer" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift

has not helped. I probably have to hunt through to find where the build puts the SwiftAudioPlayer library when it builds it? I tried the full path link to the planned (red) library, hasn't helped.

I tried:

LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftAudioPlayer" "/Users/Shared/Mobile/SScapeN2/ios/Pods/SwiftAudioPlayer" "/Users/davidmarques/Library/Developer/Xcode/DerivedData/SoundScape-djytmyjktdabszdevvureyguzznz/Build/Products/Debug-iphonesimulator/SwiftAudioPlayer/" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift

I also added those to Library search path in build settings. Tried recursive. No effect.

Where else could it be?

I have given up on this. I found it is simple and works perfectly to just add package with the github URL. Error-free.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.