Skip to content

Cannot find 'NotifierManager' in scope #136

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

Open
bpappin opened this issue Apr 12, 2025 · 2 comments
Open

Cannot find 'NotifierManager' in scope #136

bpappin opened this issue Apr 12, 2025 · 2 comments

Comments

@bpappin
Copy link

bpappin commented Apr 12, 2025

KMPNotifier and Kotlin version:
kmpnotifier version: 1.5.1, kotlin version: 2.1.10

Describe the bug
After following the instructions, i get the error:
iOSApp.swift:34:9 Cannot find 'NotifierManager' in scope

In which platform bug occurs?
ios

To Reproduce
Just hit the build

Expected behavior
Based on the instructions, it should just work.
I would prefer to have it set up as a normal dependency, that would be easier to maintain.

Additional info to help reproduce
If possible logs, or even a small sample project to help reproduce your case.

@shprotx
Copy link

shprotx commented Apr 28, 2025

Hi @mirzemehdi.

I've the same problem. I did everything based on the instruction, and I've no ideas what's wrong.
Here is my iosApp file:

`
import UIKit
import ComposeApp
import GoogleSignIn
import FirebaseCore
import FirebaseMessaging

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    LetsGoAppKt.doInitMapKit()
    FirebaseApp.configure()
    
    NotifierManager.shared.initialize(configuration: NotificationPlatformConfigurationIos(
                showPushNotification: true,
                askNotificationPermissionOnStart: true,
                notificationSoundName: nil
              )
          )
    
    window = UIWindow(frame: UIScreen.main.bounds)
    if let window = window {
        window.rootViewController = MainKt.MainViewController()
        window.makeKeyAndVisible()
    }

    return true
}

func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
    return GIDSignIn.sharedInstance.handle(url)
}

}
`

and here are fragments from my build.gradle.kts file:

listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { it.binaries.framework { export(libs.kmpNotifier) baseName = "ComposeApp" isStatic = true } }

commonMain.dependencies { ... other dependencies ... api(libs.kmpNotifier) }

I read other closed issues but they have no solutions for me. I also have no problems with java heap space. If I forgot any obvious things maybe it makes a sense to add it to the instruction? Maybe should I instal some packages from the xcode package manager?

@camka14
Copy link

camka14 commented May 16, 2025

If anyone is having this issue, I ended up resolving it but I'm not sure what steps fixed it exactly. I was trying to get the iOS app to build and run in Android Studio and happened to get this error fixed as well. The two steps I think that could have helped are:

  1. downgrading Xcode to 16.0, since I was getting a warning that this was the latest version tested with Android Studio

  2. Ensuring the Xcode project file was pointed at the xcworkspace instead of the xcodeproj file.

Image

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

3 participants