When I try to run my app using the command: npx react-native run-android --deviceId=xyz I get this build error related to expo-dev-client. Although, when I run using npx react-native run-android --variant=DevDebug (for android simulator) it builds and runs successfully (although all the image assets are not rendered - only white backgrounds - maybe happened due to different productFlavours set by other dev... this is another issue). Below is the error log and my environment, project info:-
Build Error:
> Task :expo-dev-launcher:compileReleaseWithDevLauncherKotlin FAILED
e: /Users/username/Desktop/project/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/launcher/DevLauncherClientHost.kt: (17, 8): Unresolved reference: devmenu
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/launcher/DevLauncherClientHost.kt: (18, 8): Unresolved reference: devmenu
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/launcher/DevLauncherClientHost.kt: (47, 7): Unresolved reference: RNGestureHandlerPackage
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/launcher/DevLauncherClientHost.kt: (48, 7): Unresolved reference: SafeAreaContextPackage
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/react/DevLauncherDevSupportManagerSwapper.kt: (15, 33): Unresolved reference: rncompatibility
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/react/DevLauncherDevSupportManagerSwapper.kt: (27, 37): Unresolved reference: DevLauncherDevSupportManager
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/react/DevLauncherDevSupportManagerSwapper.kt: (38, 34): Unresolved reference: DevLauncherDevSupportManager
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/react/DevLauncherDevSupportManagerSwapper.kt: (40, 103): Unresolved reference: DevLauncherDevSupportManager
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/DevLauncherPackage.kt: (15, 97): Unresolved reference: DevLauncherPackageDelegate
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/DevLauncherPackage.kt: (19, 109): Unresolved reference: DevLauncherPackageDelegate
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/DevLauncherPackage.kt: (21, 121): Unresolved reference: DevLauncherPackageDelegate
e: /Users/username/Desktop/project/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/DevLauncherPackage.kt: (23, 101): Unresolved reference: DevLauncherPackageDelegate
e: /Users/username/Desktop/project/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/DevLauncherPackage.kt: (25, 96): Unresolved reference: DevLauncherPackageDelegate
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-dev-launcher:compileReleaseWithDevLauncherKotlin'.
> Compilation error. See log for more details
package.json:
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
"expo": "^46.0.0",
"expo-dev-client": "~1.3.1",
I couldn't find anything relevant related to this error on GitHub, if anyone got any ideas on solving this issue, it would be really helpful because right now I got no clue about this error.
If anyone needs any more info, please just ask and I'll provide.
Thank you!
Related
I’m trying to build my managed workflow expo project and I’m getting this error:
Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper ‘-jvm-target’ option
Here is the relevant part from the gradlew build log:
> Task :expo-media-library:compileReleaseKotlin FAILED
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.kt: (442, 76): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.kt: (138, 32): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/albums/CreateAlbum.kt: (29, 8): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/albums/CreateAlbum.kt: (36, 8): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/CreateAsset.kt: (95, 54): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/CreateAsset.kt: (120, 7): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (20, 30): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (24, 6): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (62, 25): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (65, 26): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (78, 53): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
[stderr] e: /home/expo/workingdir/build/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/assets/GetAssetsQuery.kt: (89, 44): Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
> Task :expo-file-system:compileReleaseKotlin
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (8, 19): 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (428, 27): Type mismatch: inferred type is String? but String was expected
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (472, 29): Type mismatch: inferred type is String? but String was expected
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (561, 43): Parameter 'options' is never used
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (649, 46): Parameter 'options' is never used
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (773, 43): Unchecked cast: Any? to Map<String, Any>?
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (790, 40): 'create(MediaType?, File): RequestBody' is deprecated. Moved to extension function. Put the 'file' argument first to fix Java
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (795, 15): Unchecked cast: Any to Map<String, Any>
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (927, 49): Unchecked cast: Any? to Map<String, Any>?
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1028, 43): Unchecked cast: Any? to Map<String, Any>?
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1040, 9): 'execute(vararg FileSystemModule.DownloadResumableTaskParams?): AsyncTask<FileSystemModule.DownloadResumableTaskParams?, Void?, Void?>!' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1101, 47): 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1101, 47): 'constructor AsyncTask<Params : Any!, Progress : Any!, Result : Any!>()' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1114, 21): Variable 'count' initializer is redundant
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1248, 39): 'toLowerCase(Locale): String' is deprecated. Use lowercase() instead.
w: /home/expo/workingdir/build/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1285, 35): Type mismatch: inferred type is String? but String was expected
> Task :expo-notifications:compileReleaseKotlin
w: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/Base64Serialization.kt: (26, 45): Returning type parameter has been inferred to Nothing implicitly because Nothing is more specific than specified expected type. Please specify type arguments explicitly in accordance with expected type to hide this warning. Nothing can produce an exception at runtime. See KT-36776 for more details.
w: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoPresentationDelegate.kt: (176, 70): 'priority: Int' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoPresentationDelegate.kt: (177, 41): 'vibrate: LongArray!' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoPresentationDelegate.kt: (178, 30): 'sound: Uri!' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt: (112, 30): Unnecessary safe call on a non-null receiver of type (Mutable)Map<String!, String!>. This expression will have nullable type in future releases
> Task :expo-updates:kaptGenerateStubsReleaseKotlin
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
Execution optimizations have been disabled for 2 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
513 actionable tasks: 513 executed
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-sharing:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr] > Compilation error. See log for more details
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-media-library:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr] > Compilation error. See log for more details
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 4m 48s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
I’m using the ‘react-native-fusioncharts’ library in my project and when I tried to build the app without fusion-charts the build succeeded, even though the app actually couldn’t run on my phone.
When I run the expo-cli doctor I’m getting this if the fusion charts library is in my project:
Running "expo doctor"
- Finding all copies of expo-modules-autolinking
[stderr] [18:34:32] Expected package expo-modules-autolinking#~0.10.1
[stderr] [18:34:32] Found invalid:
[stderr] [18:34:32] expo-modules-autolinking#0.5.5
[stderr] [18:34:32] (for more info, run: npm why expo-modules-autolinking)
- Finding all copies of #expo/config-plugins
[stderr] [18:34:33] Expected package #expo/config-plugins#^5.0.0
[stderr] [18:34:33] Found invalid:
[stderr] [18:34:33] #expo/config-plugins#4.1.5
[stderr] #expo/config-plugins#4.1.5
[stderr] #expo/config-plugins#4.0.6
[stderr] [18:34:33] (for more info, run: npm why #expo/config-plugins)
- Finding all copies of #expo/prebuild-config
- Finding all copies of #unimodules/core
- Finding all copies of #unimodules/react-native-adapter
- Finding all copies of react-native-unimodules
Command "expo doctor" failed.
bash exited with non-zero code: 1
and a success if ‘fusion-charts’ is not in the project.
I searched throughout the whole project for the jvmTarget that are in all of the build.gradle files and this is what I’ve found:
node_modules/expo-media-library/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/expo-notifications/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/expo-notifications/node_modules/expo-constants/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/expo-application/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-structured-headers/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-updates-interface/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-file-system/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-constants/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-updates/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-eas-client/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-error-recovery/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-json-utils/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-sharing/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/expo-splash-screen/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-modules-core/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/react-native-fusioncharts/node_modules/expo-file-system/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/react-native-fusioncharts/node_modules/expo-constants/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/react-native-fusioncharts/node_modules/expo-modules-core/android/build.gradle: jvmTarget = JavaVersion.VERSION_1_8
node_modules/react-native-fusioncharts/node_modules/expo/android/build.gradle: jvmTarget = '1.8'
node_modules/react-native-fusioncharts/node_modules/expo-keep-awake/android/build.gradle: jvmTarget = "1.8"
node_modules/react-native-fusioncharts/node_modules/expo-font/android/build.gradle: jvmTarget = "1.8"
node_modules/expo-keep-awake/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/expo-manifests/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
node_modules/react-native-gradle-plugin/build.gradle.kts: jvmTarget = JavaVersion.VERSION_11.majorVersion
grep: node_modules/react-native-gradle-plugin/.gradle/7.3.3/executionHistory/executionHistory.bin: binary file matches
node_modules/expo-font/android/build.gradle: jvmTarget = JavaVersion.VERSION_11.majorVersion
So it seems to me that there is a problem with unmatching versions of expo plugins used in SDK 46 and in the ‘fusion-charts’ library, but I’m not really sure of it because I’m pretty new to app programming. I’ve Googled everything and couldn’t find any solution.
Has anyone here had the same problem or know how to solve it?
I upgraded freshchat from "react-native-freshchat-sdk": "^2.6.4" to "react-native-freshchat-sdk": "^4.0.3" and tried running the android app but the build failed with error
Compatible side by side NDK version was not found for android.ndkVersion '22.1.7171670'
> Task :app:compileDebugJavaWithJavac
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
500 actionable tasks: 6 executed, 494 up-to-date
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:3: error: cannot find symbol
import com.freshchat.consumer.sdk.Freshchat;
^
symbol: class Freshchat
location: package com.freshchat.consumer.sdk
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:11: error: cannot find symbol
if (Freshchat.isFreshchatNotification(message)) {
^
symbol: variable Freshchat
location: class NumidaMessagingService
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:12: error: cannot find symbol
Freshchat.handleFcmMessage(this.getApplicationContext(), message);
^
symbol: variable Freshchat
location: class NumidaMessagingService
Note: /Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/debug/java/com/numidatech/numida/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 30s
After digging into the Freshworks and
roid Github, I had to update my App Module gradle file (app/build.gradle) to include freshdesk:freshchat in dependencies like this
dependencies {
implementation 'com.github.freshdesk:freshchat-android:{latestVersion}'
}
...
implementation (project(':react-native-freshchat-sdk')){
exclude group: 'com.github.freshworks'
}
implementation 'com.github.freshdesk:freshchat-android:5.3.3'
I am suddenly getting the follow errors and I have no clue how to fix them:
Object
loc: "1224:2-26"
message: "Module not found: Error: Can't resolve './iterator.js' in 'C:\\Users\\MyApp\\node_modules\\vega-embed\\build'"
moduleIdentifier: "C:\\Users\\MyApp\\node_modules\\#angular-devkit\\build-angular\\src\\babel\\webpack-loader.js??ruleSet[1].rules[2].use[0]!C:\\Users\\my-project\\node_modules\\#ngtools\\webpack\\src\\ivy\\index.js!C:\\Users\\MyApp\\node_modules\\source-map-loader\\dist\\cjs.js??ruleSet[1].rules[3]!C:\\Users\\MyApp\\node_modules\\vega-embed\\build\\vega-embed.module.js"
moduleName: "./node_modules/vega-embed/build/vega-embed.module.js"
[[Prototype]]: Object
./node_modules/vega-embed/build/vega-embed.module.js:1224:2-26 - Warning: Module not found: Error: Can't resolve './iterator.js' in 'C:\Users\MyApp\node_modules\vega-embed\build'
I also get the following warning when I build my app:
Warning: C:\Users\MyApp\src\app\components\vega\vega.component.ts depends on 'vega-embed'. CommonJS or AMD dependencies can cause optimization bailouts.
Can someone please help me understand what is wrong and how I can resolve fix these?
I was trying to build an app via ./gradle bundlerelease
got an error everytime:
C:\Users\xxx\Desktop\app\node_modules\#react-native-firebase\app\android\src\reactnative\java\io\invertase\firebase\app\ReactNativeFirebaseAppInitProvider.java:25: error: cannot find symbol
BuildConfig.APPLICATION_ID + ".reactnativefirebaseappinitprovider";
^
symbol: variable APPLICATION_ID
location: class BuildConfig
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-firebase_app:compileReleaseJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Downgrad the gradle to 3.6.0 (in build.gradle) and rebuild the project.
classpath('com.android.tools.build:gradle:3.6.0')
I get the following error when i use logback in maven (m2e).Environment: JBOSS 7.1.1,maven,eclipse. But it work fine if i just run individually as main class. I couldn't figure out why i am getting this error, can anyone help me troubleshooting this issue and find a solution for it.
Error
17:24:23,675 ERROR [stderr] java.lang.ClassCastException: org.slf4j.helpers.NOPLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
17:24:23,681 ERROR [stderr] at com.zreflect.emyed.whiteboard.pubsub.EventLoggerAsync.logStart(EventLoggerAsync.java:116)
17:24:23,683 ERROR [stderr] at com.zreflect.emyed.whiteboard.pubsub.EventLoggerAsync.onDisconnect(EventLoggerAsync.java:62)
17:24:23,684 ERROR [stderr] at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:817)
17:24:23,686 ERROR [stderr] at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:761)
17:24:23,688 ERROR [stderr] at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:742)
17:24:23,690 ERROR [stderr] at org.atmosphere.cpr.AsynchronousProcessor.cancelled(AsynchronousProcessor.java:601)
17:24:23,691 ERROR [stderr] at org.atmosphere.container.BlockingIOCometSupport.cancelled(BlockingIOCometSupport.java:172)
17:24:23,693 ERROR [stderr] at org.atmosphere.cpr.AsynchronousProcessor$1.run(AsynchronousProcessor.java:119)
17:24:23,694 ERROR [stderr] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
17:24:23,696 ERROR [stderr] at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
17:24:23,698 ERROR [stderr] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
17:24:23,699 ERROR [stderr] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
17:24:23,703 ERROR [stderr] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
17:24:23,707 ERROR [stderr] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
17:24:23,715 ERROR [stderr] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
17:24:23,716 ERROR [stderr] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
17:24:23,718 ERROR [stderr] at java.lang.Thread.run(Thread.java:662)
The error indicates that com.zreflect.emyed.whiteboard.pubsub.EventLoggerAsync class is expecting a ch.qos.logback.classic.LoggerContext, instead it obtains a org.slf4j.helpers.NOPLoggerFactory. This usually occurs when some code tries to cast the return value of org.slf4j.LoggerFactory.getILoggerFactory and slf4j is bound to the NOP implementation because no slf4j binding was available on the class path. This is usually accompanied by an error message.
For info, if it can help, I had the same issue:
java.lang.ClassCastException: class org.slf4j.helpers.NOPLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext
with JBoss Wildfly 7.4 when using SLF4J 2.0.3 (logback 1.3.4) and this was due to https://jira.qos.ch/browse/SLF4J-548 and the wrong ClassLoader in use.
Updating to SLF4J 2.0.4 solves this NOPLogger issue