Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android build error on react native 0.55.2

Trying to run a project on react-native 0.55.2 using "react-native run-android" but getting the following error

screenshot

Configure project :rn-fetch-blob
WARNING: The following project options are deprecated and have been removed:
android.useDeprecatedNdk
NdkCompile is no longer supported



> Task :react-native-ble-manager:compileDebugJavaWithJavac FAILED
E:\premisehq-mobile-react-native\node_modules\react-native-ble-manager\android\src\main\java\it\innove\LollipopPeripheral.java:7: error: cannot find symbol
import android.support.annotation.RequiresApi;
                                 ^
  symbol:   class RequiresApi
  location: package android.support.annotation
E:\premisehq-mobile-react-native\node_modules\react-native-ble-manager\android\src\main\java\it\innove\LollipopPeripheral.java:17: error: cannot find symbol
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
 ^
  symbol: class RequiresApi
E:\premisehq-mobile-react-native\node_modules\react-native-ble-manager\android\src\main\java\it\innove\LollipopScanManager.java:11: error: cannot find symbol
import android.support.annotation.RequiresApi;
                                 ^
  symbol:   class RequiresApi
  location: package android.support.annotation
E:\premisehq-mobile-react-native\node_modules\react-native-ble-manager\android\src\main\java\it\innove\LollipopScanManager.java:20: error: cannot find symbol
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
 ^
  symbol: class RequiresApi
Note: E:\premisehq-mobile-react-native\node_modules\react-native-ble-manager\android\src\main\java\it\innove\LegacyScanManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors

FAILURE: Build failed with an exception.
like image 671
DANISH WAJID Avatar asked Mar 17 '20 10:03

DANISH WAJID


Video Answer


1 Answers

I faced same problem few months back. There was a difference in Android SDK. Try to find out the targeting version of SDK in build.gradle. The version of Android SDK and app's targeting version should be same. Hope this will help you.

like image 85
Syed Minhal Hasan Avatar answered Sep 22 '22 03:09

Syed Minhal Hasan