Skip to content
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

[Expo SDK 45] ReactNativeHostWrapperBase: Unresolved reference: RedBoxHandler #18166

Closed
artkrv opened this issue Jul 8, 2022 · 27 comments
Closed
Labels
needs validation Issue needs to be validated

Comments

@artkrv
Copy link

artkrv commented Jul 8, 2022

Summary

After upgrading RN 0.68.2 --> 0.69.1 I am facing the project build issue.

yarn android gives me an error:

image

Task :expo:compileDebugKotlin FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
347 actionable tasks: 341 executed, 6 up-to-date
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /projects/Mobile.App/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /projects/Mobile.App/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /projects/Mobile.App/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /projects/Mobile.App/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: /projects/Mobile.App/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (14, 38): Unresolved reference: RedBoxHandler
e: /projects/Mobile.App/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (42, 36): Unresolved reference: RedBoxHandler
e: /projects/Mobile.App/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt: (43, 12): Not enough information to infer type variable T

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task :expo:compileDebugKotlin

Compilation error. See log for more details
`

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

45.0.6

Environment


Gradle 7.3.3

Build time: 2021-12-22 12:37:54 UTC
Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71

Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.15 (Homebrew 11.0.15+0)
OS: Mac OS X 12.4 aarch64

expo-env-info 1.0.4 environment info:
System:
OS: macOS 12.4
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 8.4.1 - /opt/homebrew/bin/npm
Watchman: 2022.06.20.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 30, 31, 32
Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0
System Images: android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8139111
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
npmPackages:
expo: ^45.0.6 => 45.0.6
react: 18.0.0 => 18.0.0
react-native: 0.69.1 => 0.69.1
npmGlobalPackages:
eas-cli: 0.54.1
expo-cli: 5.4.12
Expo Workflow: bare

Reproducible demo

npx react-native upgrade
yarn android

@artkrv artkrv added the needs validation Issue needs to be validated label Jul 8, 2022
@eleonne
Copy link

eleonne commented Jul 9, 2022

I`m stuck for the last few days. Trying to create a new react-native project and the key lib (react native tensorflow) depends on expo. I simply can't create a new project with current expo + RN0.69. I track it down to this error, but I think it goes beyond. Aparently this class is an interface now and have to be instantiated via factory.

@thespacemanatee
Copy link
Contributor

You should never upgrade RN on Expo if it's not explicitly supported and if you do, you have to bear the consequences. SDK 46 is coming out soon, so be a little more patient.

@eleonne
Copy link

eleonne commented Jul 10, 2022

@thespacemanatee, Do you know how soon?

@Kudo
Copy link
Contributor

Kudo commented Jul 11, 2022

hi there! react-native 0.69 introduced some breaking changes that sdk 45 doesn't support. we are working on it for expo sdk 46 and it should be available for beta before the end of this month. thanks!

@Kudo Kudo closed this as completed Jul 11, 2022
ofreyssinet-ledger added a commit to LedgerHQ/ledger-live that referenced this issue Jul 15, 2022
Not working for now because of:
- Android: expo incompatibility expo/expo#18166
- iOS: facebook/react-native#34102
@neandher
Copy link

neandher commented Nov 5, 2022

same error here any help?

@mingeee
Copy link

mingeee commented Nov 5, 2022

same error here any help?

I am getting the same error too. Let me know if you have found the solution.
If I do found one, I will let you know. ^.^

@bencoopertx
Copy link

same error here any help?

I am getting the same error too. Let me know if you have found the solution. If I do found one, I will let you know. ^.^

Same... except I'm getting on same old react native version 0.64.3

@dion-
Copy link

dion- commented Nov 5, 2022

Suddenly experiencing this issue on RN version 0.68.2

@bencoopertx
Copy link

bencoopertx commented Nov 5, 2022

Wonder are we all suddenly here today... what's the linking piece?

@bencoopertx
Copy link

bencoopertx commented Nov 5, 2022

Here's my full log, getting on "react-native": "0.64.3" and "expo": "^43.0.0"
e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (14, 38): Unresolved reference: RedBoxHandler e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (28, 15): Unresolved reference: onWillCreateReactInstanceManager e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (36, 15): Unresolved reference: onDidCreateReactInstanceManager e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (42, 36): Unresolved reference: RedBoxHandler e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (43, 12): Not enough information to infer type variable T e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 3): 'getUIImplementationProvider' overrides nothing e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 76): Unresolved reference: UIImplementationProvider e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (52, 12): Not enough information to infer type variable T

@mingeee
Copy link

mingeee commented Nov 5, 2022

Here's my full log, getting on "react-native": "0.64.3" and "expo": "^43.0.0" e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (14, 38): Unresolved reference: RedBoxHandler e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (28, 15): Unresolved reference: onWillCreateReactInstanceManager e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (36, 15): Unresolved reference: onDidCreateReactInstanceManager e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (42, 36): Unresolved reference: RedBoxHandler e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (43, 12): Not enough information to infer type variable T e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 3): 'getUIImplementationProvider' overrides nothing e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 76): Unresolved reference: UIImplementationProvider e: /Users/bencooper/Desktop/projects/every-two/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (52, 12): Not enough information to infer type variable T

That is the same error I have got but I am running expo 45 and rn 68. Tested on rn 69 too...

If I upgrade to expo 46, it spit out this error:
image

@williamliangwl
Copy link

I'm getting the same error message, the builds were working fine yesterday

I'm using expo 46 and rn 69.4

@mingeee
Copy link

mingeee commented Nov 5, 2022

It could be related to this: I think?!
facebook/react-native#35210 (comment)

@neandher
Copy link

neandher commented Nov 5, 2022

Fix is here too 02fb0a9

@bencoopertx
Copy link

It could be related to this: I think?! facebook/react-native#35210 (comment)

Fixed it for me. Thank you 👏

@younthu
Copy link

younthu commented Nov 6, 2022

Suddenly experiencing this issue on RN version 0.68.2

@desca595
Copy link

desca595 commented Nov 6, 2022

Experiencing the same also with "react-native": "0.68.2"
the fix 02fb0a9 also worked for me!

@NantEiPhyoThet
Copy link

Has anyone here who are having this build failed issue tried to build signed bundle/apk for android? Because the solutions here react-native/issues/35210 and (expo/expo@02fb0a9), it makes the build for android successful on emulator and on real device. But my signed bundle/apk is crashing as soon as it's downloaded and opened.
I'm on RN 0.66 and I've tried gradle 6.9.0, 7.0.1 and 7.2.1 and my signed bundle is still crashing with no error messages shown.

@Yandamuri
Copy link

It could be related to this: I think?!
facebook/react-native#35210 (comment)

This solution worked for me. I was in RN 0.64.3 then installed RN 0.64.4. Issue got resolved.

@congcong09
Copy link

That is the same error I have got but I am running expo 45 and rn 68. Tested on rn 69 too...

If I upgrade to expo 46, it spit out this error: image

Did you fix it? I met the problem too.

@mingeee
Copy link

mingeee commented Nov 10, 2022

That is the same error I have got but I am running expo 45 and rn 68. Tested on rn 69 too...
If I upgrade to expo 46, it spit out this error: image

Did you fix it? I met the problem too.

Yeah! follow the fix here:
facebook/react-native#35210 (comment)

@OneLoneFox
Copy link

Updating react native to the corresponding patch mentioned in the issue above solves the problem however if you ever use "expo prebuild" expo will insist on using a broken version and update your package.json and install the broken version, in my case Expo SDK 45 with react native 0.68.2 (the fixed version is 0.68.5)

@ilyavf
Copy link

ilyavf commented Nov 16, 2022

It could be related to this: I think?!
facebook/react-native#35210 (comment)

This solution worked for me. I was in RN 0.64.3 then installed RN 0.64.4. Issue got resolved.

I was also on 0.64.3, but upgrading to 0.64.4 did not help. But I first was getting different errors.

Here is my full history (I am on expo 44.0.6, bare workflow, gradle 6.9).

First: Execution failed for task ':app:checkReleaseAarMetadata'.

The minCompileSdk (31) specified ... is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat:1.4.1

This is when I upgraded to 0.64.4 but the error stayed.
I cannot upgrade minCompileSdk to 31, so to move forward I had to specify versions for the following packages in android/app/build.gradle:

force 'androidx.appcompat:appcompat:1.2.0'
force 'androidx.appcompat:appcompat-resources:1.2.0'
force 'androidx.tracing:tracing:1.0.0'
force 'androidx.tracing:tracing-ktx:1.0.0'

Then, the next error was:

Execution failed for task ':expo-modules-core:compileReleaseKotlin'.
...
e: /Users/ilya/.gradle/caches/transforms-3/0391baf9a5d979baeff13af67647940b/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1.
... (and lots of similar errors) ...

To fix this I had to specify the version of Kotlin in android/build.gradle:

kotlinVersion = "1.6.0"

And now I am getting the error described in this issue:

Task :expo:compileReleaseKotlin FAILED
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (14, 38): Unresolved reference: RedBoxHandler
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (42, 36): Unresolved reference: RedBoxHandler
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (43, 12): Not enough information to infer type variable T
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 3): 'getUIImplementationProvider' overrides nothing
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (51, 76): Unresolved reference: UIImplementationProvider
node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (52, 12): Not enough information to infer type variable T

@ilyavf
Copy link

ilyavf commented Nov 16, 2022

This is what helped me: facebook/react-native#35249 (comment)

@MkrierPharmanity
Copy link

MkrierPharmanity commented Nov 17, 2022

got the same error, its a new project with react native v0.70.5

@ibravoh
Copy link

ibravoh commented Nov 23, 2022

hi Guys, I have been battling with this for the past few days and i still cannot get my app to build I have tried everything here and here https://github.com/facebook/react-native/issues/35210 too . but nothing has worked so far. I am stuck.
I am using a bare workflow but installed expo SDK to be able to use thinks like expo-fonts, e.t.c
React native version : 0.69.3
expo SDK version : 46.0.0

below are the errors that i have been getting.

Please help!

*Configure project :expo-modules-core
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script '/Users/ibrahimiliyasu/Desktop/Projects/zp_customer_app/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 272

  • What went wrong:
    A problem occurred evaluating project ':expo'.

A problem occurred configuring project ':expo-modules-core'.
Failed to notify project evaluation listener.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/ibrahimiliyasu/Desktop/Projects/zp_customer_app/android/local.properties'.
> Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':expo'.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 4m 28s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script '/Users/ibrahimiliyasu/Desktop/Projects/zp_customer_app/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 272

  • What went wrong:
    A problem occurred evaluating project ':expo'.

A problem occurred configuring project ':expo-modules-core'.
Failed to notify project evaluation listener.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/ibrahimiliyasu/Desktop/Projects/zp_customer_app/android/local.properties'.
> Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':expo'.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 4m 28s

@Ozaoujal
Copy link

Ozaoujal commented Dec 8, 2023

same issue, with RN0.70.1, but upgrading expo the issue's gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests