I’m really enjoying The Complete 2020 Flutter Development Bootcamp with Dart on Udemy by Angela Yu and London App Brewery. I like how Angela has organized the progression of concepts and challenges. It’s also easy to skip lectures if you’re already an experienced programmer and don’t need to learn concepts like data types and function syntax.
My first big snag came when I added the audioplayers package to the Xylophone project. The run tab fills up with errors, ending with:
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Right above that was a bunch of errors like this, which actually sent me down the wrong path investigating this:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Pods-Runner' from project 'Pods')
Scrolling to the top of the window, I found:
Error output from Xcode build: ↳ ** BUILD FAILED **Xcode's output: ↳ ld: warning: Could not find or use auto-linked library 'swiftCore' ld: warning: Could not find or use auto-linked library 'swiftQuartzCore' ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics' [lots more like this]
Googling these messages led to more useful solutions. The best I found was here: https://stackoverflow.com/questions/50096025/it-gives-errors-when-using-swift-static-library-with-objective-c-project/50495316#50495316, and I figured it might help someone if I provide updated instructions and a screenshot from Xcode 12.
- Run Xcode
- File – Open – [your project]/ios/Runner.xcodeproj
- File – New – File
- Select “Swift File”, click “Next”
- Click “Create”
- Click “Create Bridging Header”
- Click on “Runner” at the top left
- Click “Build Settings”
- Change “Always Embed Swift Standard Libraries” to “Yes”
- Now you can close Xcode and the app should build in Android Studio