Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Not found ios/Runner/AppDelegate.m file. #9

Closed
joshephan opened this issue Jan 11, 2020 · 7 comments
Closed

Not found ios/Runner/AppDelegate.m file. #9

joshephan opened this issue Jan 11, 2020 · 7 comments

Comments

@joshephan
Copy link

Unable to find file while writing code following guide document.
I created a new plutter project through the Android studio, and my Runner folder looks like this.
제목 없음

There are no AppDelegate.m and AppDelegate.h files, but only AppDelegate.swift file exist. How do I proceed with the guide in this case?

@joshephan
Copy link
Author

joshephan commented Jan 11, 2020

I didn't see former issue.

Edit AppDelegate.swift file to following code.

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR_API_KEY")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

@yukon-pasindujayanath
Copy link

@joshephan
Why did you close this issue? Could you fix this?

@domesticmouse
Copy link
Contributor

@yukon-pasindujayanath are you hitting the same issue? Around Flutter 1.17 we switched from generating Objective C files to Swift files by default. I've updated the codelab to take this reality into account.

However, it is time for me to update the codelab again, so I'm interested to understand what issues you are hitting.

@abhijeet-arya
Copy link

I didn't see former issue.

Edit AppDelegate.swift file to following code.

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR_API_KEY")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Where is AppDelegate.swift file in flutter

@kkmurerwa
Copy link

Did you find the location of AppDelegate.swift in Flutter?

@aososam
Copy link

aososam commented Jun 9, 2021

I found AppDelegate.swift in the folder ios/Runner but I still cannot find AppDelegate.m

@domesticmouse
Copy link
Contributor

@aososam only one of AppDelegate.swift or AppDelegate.m is generated. You can choose which when you instantiate a project by selecting the default language for iOS, either Swift or Objective C. Any particular reason you want the Objective C version?

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

No branches or pull requests

6 participants