Error: cannot find symbol import com.swmansion.rnscreens.RNScreensPackage. #2101
Replies: 4 comments
-
Hey, your issue description suggests me that React Native CLI did include Would you send me output of Also, do you have anything unusual / custom in your setup, or is this just standard react native application straight from template? |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue After i upgraded my RN version:
this is my MainApplication.kt file package com.dairypureappinv
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.soloader.SoLoader
import com.swmansion.rnscreens.RNScreensPackage
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Add RNScreensPackage here for explicit linking (optional)
add(RNScreensPackage())
}
override fun getJSMainModuleName(): String = "index"
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Same problem here! |
Beta Was this translation helpful? Give feedback.
-
Try this, worked for me after upgrade to targetSdkVersion = 34 delete node_modules
cd android |
Beta Was this translation helpful? Give feedback.
-
Hello everyone !
I am having issues with my app not building when I install react-native-screens. I am currently receiving two errors that relate to not found symbols:
I have followed the installation guide and I have edited my
MainActivity.kt
file with the recommended Kotlin code, as well as addingimport android.os.Bundle;
to the top of the file.I am not entirely sure how to fix this. I haven't seen many people having similar issues with installing react-native-screens.
Here are the versions of the dependencies I am currently using:
And my build.gradle
It would be greatly appreciated to know if you have faced a similar issue and how you came about solving it.
Thank you for your time! ❤️
Diana
Beta Was this translation helpful? Give feedback.
All reactions