lambda expressions are not supported in -source 7
See original GitHub issueHi.
When running app using command: npx react-native run-android
or building with Android Studio, it always returns this error:
node_modules/react-native-ble-manager/android/src/main/java/it/innove/BleManager.java:747:
error: lambda expressions are not supported in -source 7
scanManager.stopScan(args -> {});
^
(use -source 8 or higher to enable lambda expressions)
To Reproduce
Steps to reproduce the behavior:
- After install all packages
- Start app by command:
npx react-native run-android
- See error
Expected behavior It must build the app successfully.
Screenshots Having the same error when building by Android Studio:
Smartphone (please complete the following information):
- Device: Samsung A52s 5G
- OS: Android 12
- react-native-ble-manager version: 8.3.0
- react-native version: 0.66.0
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 31
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.0')
}
}
Full error log
> Task :react-native-ble-manager:generateDebugBuildConfig UP-TO-DATE
> Task :react-native-ble-manager:compileDebugRenderscript NO-SOURCE
> Task :react-native-ble-manager:generateDebugResValues UP-TO-DATE
> Task :react-native-ble-manager:generateDebugResources UP-TO-DATE
> Task :react-native-ble-manager:packageDebugResources UP-TO-DATE
> Task :react-native-ble-manager:parseDebugLocalResources UP-TO-DATE
> Task :react-native-ble-manager:processDebugManifest UP-TO-DATE
> Task :react-native-ble-manager:generateDebugRFile UP-TO-DATE
> Task :react-native-ble-manager:javaPreCompileDebug UP-TO-DATE
> Task :react-native-ble-manager:compileDebugJavaWithJavac FAILED
10 actionable tasks: 2 executed, 8 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
/Users/canhqn/Documents/cartek/node_modules/react-native-ble-manager/android/src/main/java/it/innove/BleManager.java:747: error: lambda expressions are not supported in -source 7
scanManager.stopScan(args -> {});
^
(use -source 8 or higher to enable lambda expressions)
1 error
FAILURE: Build failed with an exception.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Compilation failure: lambda expressions are not supported in
java - Compilation failure: lambda expressions are not supported in -source 7 - Stack Overflow. Stack Overflow for Teams – Start collaborating ...
Read more >lambda expressions are not supported in -source 7 - B4X
I can bypass the lambdas. Now I get package android.os.Bundle does not exist when I am pointing to Android 28 or 30.
Read more >lambda expressions are not supported in -source 7 #1 - GitHub
pub-cache/hosted/pub.dartlang.org/startapp_sdk-0.1.5/android/src/main/java/com/startapp/flutter/sdk/StartAppSdkPlugin.java:90: error: lambda ...
Read more >Compilation failure lambda expressions are not supported
SYMPTOM. When adding a lambda expression in a java code maven throws the following error: [ERROR] Failed to execute goal org.apache. · CAUSE....
Read more >Lambda expressions are not supported in source 1.7
As you may have noticed, lambda expressions are not supported in source 1.7. This is because lambdas were added in Java 7 and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also faced this issue (release 8.4.0). My solution: Firstly, add lines into node_modules/react-native-ble-manager/android/build.gradle (link)
Finally, I used patch-package to patch this library, please run this command in terminal:
yarn patch-package react-native-ble-manager
So, hope this help everybody
+1