question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XCode archive error 'No such module flutter_downloader' when using AppDelegate.swift

See original GitHub issue

I can’t archive the project with XCode if I use AppDelegate.swift as stated in the docs. Both flutter run --release and flutter build ios work.

  • XCode: Version 11.3.1 (11C504)

  • AppDelegate.swift:

import UIKit
import Flutter
import flutter_downloader

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

private func registerPlugins(registry: FlutterPluginRegistry) {
    if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
       FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin"))
    }
}
  • flutter doctor -v:
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.1 19B88, locale pt-BR)
    • Flutter version 1.12.13+hotfix.7 at /Users/JHBitencourt/Documents/
    • Framework revision 9f5ff2306b (8 weeks ago), 2020-01-26 22:38:26 -0800
    • Engine revision a67792536c
    • Dart version 2.7.0
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/JHBitencourt/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.0.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
  • Error:

image_error

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

30reactions
KarimMohamed20commented, May 5, 2020

Open xcworkspace instead of xcodeproj and it will work fine

14reactions
nivla360commented, Aug 3, 2020

None of the above solutions worked for me so this is how I solved mine:

  1. Run flutter clean
  2. Open the project folder navigate to ios directory and delete the ‘Pods’ folder
  3. Open terminal and navigate to ios directory in your project folder and run pod install
  4. When done, open ‘Runner.xcworkspace’
  5. In Xcode, clean the build folder by going to Product > Clean Build Folder
  6. Build the project (Product > Build) and everything should work fine.
Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - XCode archive error 'No such module flutter_downloader ...
XCode archive error 'No such module flutter_downloader' when using AppDelegate.swift. enter image description here.
Read more >
xcodebuild returns "Error: No such module" - Apple Developer
I can build and archive in Xcode from the GUI, but xcodebuild fails with 482 errors, and at least the last few are...
Read more >
Xcode 12.0.1 "No such module" | Apple Developer Forums
Works on a device, fails for the simulator. With a simple new iOS App project I was able to use the Cocoapods and...
Read more >
No Such Module - 'WatchKit' | Apple Developer Forums
When I compile it, I get two errors: - WatchKit is not available when building for iOS Simulator. - No such Module, WatchKit...
Read more >
SPM in project pre Xcode 11 - 'No … | Apple Developer Forums
I've a issue with integrating swift packages into projects that were created via e.g. ... In addition to "no such module" errors, some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found