Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 12 + AudioKit 4.11 Problems #2267

Closed
vojtabohm opened this issue Sep 16, 2020 · 82 comments
Closed

Xcode 12 + AudioKit 4.11 Problems #2267

vojtabohm opened this issue Sep 16, 2020 · 82 comments
Assignees

Comments

@vojtabohm
Copy link

Hi. I just wanted to ask if there is a planned support for v4 of AudioKit in Xcode 12? Or if there is a documentation for the v5 beta version which works in Xcode 12.

I cannot compile my app in Xcode 12 and hence cannot prepare it for the iOS 14 which is now already released. I have went into detail in this stackoverflow post.
https://stackoverflow.com/questions/63860545/implementing-microphone-analysis-with-audiokit-v5

Thank you.

@aure
Copy link
Member

aure commented Sep 17, 2020

Yeah, well I just compiled AudioKit for Xcode 12, it was easy, but as long as @megastep is cool with it, we'll make an AudioKit 4.11 release for Xcode 12 shortly.

@aure
Copy link
Member

aure commented Sep 17, 2020

https://github.com/AudioKit/AudioKit/releases/tag/v4.11 will be updated with frameworks etc soon, and hopefully cocoapods as well.

@megastep
Copy link
Member

Just pushed the v4.11 pod for Xcode 12 - let me know if it works for you!

If you want to play with v5, we do have an experimental pod version 5.0.b2 - though you should consider using SPM instead.

@pavelko3lov
Copy link

Hi, we have multiple errors:
for instance:
"Failed to build module 'AudioKit' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced"

Using last version:

  • AudioKit (4.11):
    • AudioKit/Core (= 4.11)
    • AudioKit/UI (= 4.11)
  • AudioKit/Core (4.11)
  • AudioKit/UI (4.11):
    • AudioKit/Core

@megastep
Copy link
Member

Mmh, I did remove a bit of script that I thought was no longer needed, fixing the Swift module interfaces. I might have to turn that back on...

@megastep
Copy link
Member

OK, I just updated the zip file. Please clean your pod cache and try again with a clean install...

@ryangenz
Copy link

How does one know if they are installing the New 4.11 or the Old 4.11 ?
I just updated but I seem to be getting the same errors mentioned by fvonk. Which makes me think I didn't really update the pod. ;)

@megastep
Copy link
Member

I would do pod cache clean --all, then just delete your Pods directory and do a new pod install

@pavelko3lov
Copy link

Ok, but now we have
"Cannot find 'output' in scope"
"Cannot find 'midi' in scope"
errors...

@ryangenz
Copy link

Yes same errors here

@brizzly
Copy link

brizzly commented Sep 17, 2020

Same erreur here

@trevor-sonic
Copy link
Contributor

trevor-sonic commented Sep 17, 2020

I should have checked here before jump into the Xcode 12 :-/ (my mistake).

@vojtabohm
Copy link
Author

Yes, I can also confirm I have the same errors. On the bright side - before the updates I had 2567 errors and now I only have 6 of them 😄
image

@meilers
Copy link

meilers commented Sep 18, 2020

Thanks for the updated builds @aure. However, I'm running into this issue when archiving my app (see screenshot). Any ideas? I used the 4.11 framework from the link https://github.com/AudioKit/AudioKit/releases/tag/v4.11

Screen Shot 2020-09-17 at 9 17 26 PM
.

@megastep
Copy link
Member

@meilers are you on Xcode 11 still? These new frameworks include ARM64 slices for the simulator for the new Macs with Apple Silicon. I thought these would be simply ignored by previous versions.

@meilers
Copy link

meilers commented Sep 18, 2020

@megastep Nope. On Xcode 12 since yesterday.

Screen Shot 2020-09-17 at 10 00 45 PM

@megastep
Copy link
Member

uh, that is odd - is it only happening when archiving your app?

@meilers
Copy link

meilers commented Sep 18, 2020

@megastep Correct. I can run the app just fine in the simulator.

@megastep
Copy link
Member

Maybe that's a limitation because you can't submit apps for Apple Silicon yet? Did you override any architecture settings in your project/target?

It makes little sense to me because this is an XCFramework and when you archive for a device the simulator stuff should just be completely ignored.

@meilers
Copy link

meilers commented Sep 18, 2020

@megastep I agree it is weird. What do the simulators have to do with archives? And no, I didn't override any architecture settings. It's a pretty vanilla project. Let me try with a new project and I'll let you know.

@megastep
Copy link
Member

One of the biggest problems with publishing universal binary frameworks with Xcode 12 is because of this Apple Silicon slice - so you end up having arm64 slices for both the iOS and Mac architectures. Pretty much have to rely only on XCFrameworks at this point as we can't splice together these same-CPU slices anymore.

At the same time AK4 was triggering some bugs in LLVM because of the AudioKit class, and it appears that is still the case. That doesn't necessarily mean that we can't ship functioning frameworks for CocoaPods here, but it might take more work than anticipated.

If you can't wait you can checkout the v5-develop branch which fully supports the Swift Package Manager.

@meilers
Copy link

meilers commented Sep 18, 2020

@megastep Thanks for the clarification. That makes sense.

By the way, just tested on a brand new project. Dumped the frameworks from the previous link. and same error when archiving.

Screen Shot 2020-09-17 at 10 14 56 PM

@meilers
Copy link

meilers commented Sep 18, 2020

@megastep Are you sure that SPM works for AudioKitUI? It works for AudioKit, but not for AudioKitUI. I'm getting the "No such module AudioKitUI" error.

@aure
Copy link
Member

aure commented Sep 18, 2020

@meilers No more AudioKitUI in AudioKit5.

@aure
Copy link
Member

aure commented Sep 18, 2020

Mostly its in there, just don't have to import a separate framework anymore.

@meilers
Copy link

meilers commented Sep 18, 2020

@aure Not sure I understand. If I remove "import AudioKitUI" I get plenty more reference errors like "Cannot find type AKNodeOutputPlot in scope". Am I missing something here?

@aure
Copy link
Member

aure commented Sep 18, 2020

@meilers are you saying that you're using SPM with AudioKit 4.11? I was under the impression it only worked with v5. @megastep ?

@aure
Copy link
Member

aure commented Sep 18, 2020

@meilers If you are using v5, try dropping the AK prefix on the classes it says it can't find. Most of those have been dropped, except a few like AKMIDI.

@meilers
Copy link

meilers commented Sep 18, 2020

@aure Yes, I should be. I'm pointing to the v5-develop branch.

@isayeter
Copy link

isayeter commented Sep 20, 2020

v4.11.1 is now out and the pod was pushed; let me know if this fixes your issues (it should). You will have to update your code to replace all references to the AudioKit class to AKManager instead. In most cases this should just be a 2-3 line code change.

I missed that comment, now everything is working, thank you so much for your amazing effort.

edit: sorry for that but when I install v4.11.1 into simulator, everything is working fine, success built, but when I try to run on my real device which has ios 14, I got those errors:

Screen Shot 2020-09-20 at 03 31 54

I have tried to change import AudioKit to import AKManager also, but it produces: No such module 'AKManager'. I have also done a clean build folder, pod cache clean and deleted Pods folder.

@megastep
Copy link
Member

Well that is interesting, it should definitely work the same for devices as the simulator. The target error is weird though - why would it be looking for ARM64 simulator unless you are on an Apple Silicon Mac?

@megastep
Copy link
Member

FYI I don't get any of these errors with the new frameworks, compiling for devices or archiving. If you are actually on Apple Silicon, you'd be better off actually switching to v5.

@mocman
Copy link

mocman commented Sep 20, 2020

I'm having the exact same issues as @fattalgazi, and I'm on a 16 inch Intel. Currently running through a list of possible fixes and will get back to this thread if I find one that works.

@megastep
Copy link
Member

What's your iOS SDK target version in your project? You might need to raise it to something more recent.

@mocman
Copy link

mocman commented Sep 20, 2020

What's your iOS SDK target version in your project? You might need to raise it to something more recent.

12.4
Which is weird that they're looking for the "arm64-apple-ios10.0-simulator"
Edit: I raised it to 13 with a clean build and it still didn't get rid of any of the errors.

@megastep
Copy link
Member

Not happening for me with my own project using the pod, and I'm targeting iOS 10. I would guess that maybe CocoaPods might be responsible for this... I am using the latest beta of 1.10.

@b-hutchison
Copy link
Sponsor

Updating CocoaPods from 1.9.3 to 1.10.0.rc.1 got rid of the "unable to load standard library" errors when running on a device for me.

@megastep
Copy link
Member

Good to hear. Sounds like something they needed to address for Xcode 12.

@peterjdann
Copy link

peterjdann commented Sep 20, 2020 via email

@b-hutchison
Copy link
Sponsor

I have a similar new runtime error too. Mine occurs both on simulator and device. For the line:
var drums = AKMIDISampler()
I get the error:
Fatal error: Use of unimplemented initializer 'init()' for class 'AudioKit.AKMIDISampler'

@megastep
Copy link
Member

Sounds like something else to do with the generated Swift interfaces - I suggest opening a different issue for this.

@abinop
Copy link

abinop commented Sep 20, 2020

@fattalgazi

I have tried to change import AudioKit to import AKManager also, but it produces: No such module 'AKManager'. I have also done a clean build folder, pod cache clean and deleted Pods folder.

You don't need to change the import, you keep import AudioKit. You have to change where AudioKit is used, for example, change
AudioKit.output = to AKManager.output =
AudioKit.start() to AKManager.start()
etc

@vojtabohm
Copy link
Author

Running pod update does not update to 4.11.1. What am I doing wrong? On cocoapods.org it also shows that 4.11 is the latest release.

@vojtabohm
Copy link
Author

Manually downloading the package from the "releases" tab and inserting it into the /Pods folder did the trick though.

@abinop
Copy link

abinop commented Sep 20, 2020

@vojtabohm > Running pod update does not update to 4.11.1. What am I doing wrong? On cocoapods.org it also shows that 4.11 is the latest release.

pod 'AudioKit' , '~> 4.11.1'

@isayeter
Copy link

Ok updating cocopods solves all problems. Thank you.
sudo gem install cocoapods --pre

@coryl
Copy link

coryl commented Sep 20, 2020

I'm running a MacOS project and was having trouble getting rid of all the errors with the new 4.11.1 build.

pod cache clean -all wasn't quite working
Turns out a complete pod reset fixed it.

rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install

https://stackoverflow.com/a/46428793/339946

@bojanstef
Copy link

@megastep on Xcode Version 12.0 (12A7209) I still get these two issues with 4.11.1. I tried deleting derived data, cleaning pod cache, de-integrating and installing pods again but nothing fixed it.

# At `import AudioKit`
Unable to load standard library for target 'arm64-apple-ios10.0-simulator'
Failed to build module 'AudioKit' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced

The only AudioKit references I have are these lines:

var options = AKConverter.Options()
let converter = AKConverter(inputURL: URL(), outputURL: URL(), options: options)
converter.start { /* ... */ }

@b-hutchison
Copy link
Sponsor

Updating CocoaPods to 1.10.0.rc.1 got rid of the "unable to load standard library" errors for me.

@elcitrovmtgrande
Copy link

Thank you @aure @megastep for your amazing work. Now it works on 4.11.1 for me. Just had to change de pod ios platform from 9.0 to 11.0.
Thank you guys. I stay here to help if needed.
Best,
@elcitrovmtgrande

@brizzly
Copy link

brizzly commented Sep 21, 2020

Building ok with 4.11.1 and Xcode12 and a few AudioKit.* renames.
Crash when I run my app though
Fatal error: Use of unimplemented initializer 'init()' for class 'AudioKit.AKMIDISampler'

New issue added here : #2276
Thanks a lot

@vojtabohm
Copy link
Author

I confirm everything working with 4.11.1 for me. Thank you @aure @megastep.

@elcitrovmtgrande
Copy link

elcitrovmtgrande commented Sep 21, 2020

Building ok with 4.11.1 and Xcode12 and a few AudioKit.* renames.
Crash when I run my app though
Fatal error: Use of unimplemented initializer 'init()' for class 'AudioKit.AKMIDISampler'

New issue added here : #2276
Thanks a lot

Hi @brizzly, just replace AudioKit by AKManager.ADMIDISampler, I guess...

@brizzly
Copy link

brizzly commented Sep 21, 2020

Building ok with 4.11.1 and Xcode12 and a few AudioKit.* renames.
Crash when I run my app though
Fatal error: Use of unimplemented initializer 'init()' for class 'AudioKit.AKMIDISampler'
New issue added here : #2276
Thanks a lot

Hi @brizzly, just replace AudioKit by AKManager.ADMIDISampler, I guess...

It was not enough , but another work around did the trick, to know more about it have a look at the issue 2276

@tehsven
Copy link

tehsven commented Sep 21, 2020

Updated to v4.11.1, updated cocoapods to 1.10.0.rc.1, removed derived data, and the build is working again. However now I am seeing missing PCM files, the same issue that was reported on #1247 and #1325:

warning: /var/folders/zg/rxr8tgkn1ylf0hm8crrnrc840000gq/C/org.llvm.clang.megastep/ModuleCache/1BAOMPOQVXYU7/AVFoundation-7O317LEIB4Z2.pcm: No such file or directory
note: while processing /var/folders/zg/rxr8tgkn1ylf0hm8crrnrc840000gq/C/org.llvm.clang.megastep/ModuleCache/1BAOMPOQVXYU7/AVFoundation-7O317LEIB4Z2.pcm
note: Linking a static library that was built with -gmodules, but the module cache was not found.  Redistributable static libraries should never be built with module debugging enabled.  The debug experience will be degraded due to incomplete debug information.

Screen Shot 2020-09-21 at 9 38 24 AM

@megastep
Copy link
Member

Looks like these are referencing files that are on my Mac since I'm the one who built the binaries... :/

@trevor-sonic
Copy link
Contributor

I could install AudioKit 4.11 by get riding off Pod then adding AudioKit into the workspace.
For me, every time using Pods I ended up return back to manual integration, slower but clean and safe.
V5 is coming with SPM thanks a lot. I wish to be able to use SPM for V4 as well (but this is already answered somewhere here that was not possible)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests