InjectionIII: Could not locate compile command

I am using injection on my new ios(13.0+) app without storyboards (not swiftui).

💉 ⚠️ Could not locate compile command for /Users/axel/MyApp/ViewController.swift.
This could be due to one of the following:
1. Injection does not work with Whole Module Optimization.
2. There are restrictions on characters allowed in paths.
3. File paths in the simulator are case sensitive.
4. The modified source file is not in the current project.
5. The source file is an XCTest that has not been run yet.
Try a build clean then rebuild to make logs available or
consult: "/Users/axel/Library/Developer/CoreSimulator/Devices/08177A3D-A71D-422E-A306-298729AD01C1/data/Containers/Data/Application/2C01F92B-C26B-495A-82A3-8B014D060F74/tmp/command.sh".

AppDelegate.swift

@main
class AppDelegate: UIResponder, UIApplicationDelegate {


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        #if DEBUG
        Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
        #endif

        return true
    }
}

AppCode: 2022.1.2 XCode: 13.2 Injection: 4.2.7

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Works perfectly. Thank you.