eddieowens / react-native-boundary

Native implementation of geofencing/region monitoring
Apache License 2.0
121 stars 72 forks source link

App Error JobIntentService #66

Open Sudhakar91221 opened 1 year ago

Sudhakar91221 commented 1 year ago

Hi Team Getting below error in React native latest version(0.71.8) Project Version details: "react": "18.2.0", "react-native": "0.71.8", "react-native-boundary": "^1.1.1",

D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\receivers\BoundaryEventBroadcastReceiver.java:6: error: cannot find symbol import android.support.v4.app.JobIntentService; ^ symbol: class JobIntentService location: package android.support.v4.app D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:7: error: package android.support.annotation does not exist import android.support.annotation.NonNull; ^ D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:8: error: cannot find symbol import android.support.v4.app.ActivityCompat; ^ symbol: class ActivityCompat location: package android.support.v4.app D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventHeadlessTaskService.java:5: error: package android.support.annotation does not exist import android.support.annotation.Nullable; ^ D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:6: error: package android.support.annotation does not exist import android.support.annotation.NonNull; ^ D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:7: error: cannot find symbol import android.support.v4.app.JobIntentService; ^ symbol: class JobIntentService location: package android.support.v4.app D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:20: error: cannot find symbol public class BoundaryEventJobIntentService extends JobIntentService { ^ symbol: class JobIntentService D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventHeadlessTaskService.java:12: error: cannot find symbol @Nullable ^ symbol: class Nullable location: class BoundaryEventHeadlessTaskService D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:30: error: cannot find symbol protected void onHandleWork(@NonNull Intent intent) { ^ symbol: class NonNull location: class BoundaryEventJobIntentService D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:60: error: cannot find symbol public void onFailure(@NonNull Exception e) { ^ symbol: class NonNull D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:143: error: cannot find symbol int permission = ActivityCompat.checkSelfPermission(getReactApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION); ^ symbol: variable ActivityCompat location: class RNBoundaryModule D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:166: error: cannot find symbol public void onFailure(@NonNull Exception e) { ^ symbol: class NonNull D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:175: error: cannot find symbol int permission = ActivityCompat.checkSelfPermission(getReactApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION); ^ symbol: variable ActivityCompat location: class RNBoundaryModule D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:200: error: cannot find symbol public void onFailure(@NonNull Exception e) { ^ symbol: class NonNull D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:220: error: cannot find symbol public void onFailure(@NonNull Exception e) { ^ symbol: class NonNull D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:228: error: cannot find symbol ActivityCompat.requestPermissions(getReactApplicationContext().getCurrentActivity(), ^ symbol: variable ActivityCompat location: class RNBoundaryModule D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java:234: error: cannot find symbol return ActivityCompat.checkSelfPermission(getReactApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION); ^ symbol: variable ActivityCompat location: class RNBoundaryModule D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\receivers\BoundaryEventBroadcastReceiver.java:21: error: cannot find symbol JobIntentService.enqueueWork(context, BoundaryEventJobIntentService.class, 0, intent); ^ symbol: variable JobIntentService location: class BoundaryEventBroadcastReceiver D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:29: error: method does not override or implement a method from a supertype @Override ^ D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:46: error: cannot find symbol sendEvent(this.getApplicationContext(), ON_ENTER, enteredGeofences); ^ symbol: method getApplicationContext() D:\MySamples\RNGeofenceTesting\node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java:54: error: cannot find symbol sendEvent(this.getApplicationContext(), ON_EXIT, exitingGeofences); ^ symbol: method getApplicationContext() 21 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 1m 21s

at makeError (D:\MySamples\RNGeofenceTesting\node_modules\execa\index.js:174:9)
at D:\MySamples\RNGeofenceTesting\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\MySamples\RNGeofenceTesting\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (D:\MySamples\RNGeofenceTesting\node_modules\@react-native-community\cli\build\index.js:108:9)

info Run CLI with --verbose flag for more details.

harshit-kishor2 commented 1 year ago

Here are steps to fix it -

  1. node_modules\react-native-boundary\android\src\main\java\com\eddieowens\receivers\BoundaryEventBroadcastReceiver.java

// import android.support.v4.app.JobIntentService; (comment this line) import androidx.core.app.JobIntentService; (add this line)

  1. node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventHeadlessTaskService.java

// import android.support.annotation.Nullable; import androidx.annotation.NonNull;

public class BoundaryEventHeadlessTaskService extends HeadlessJsTaskService { // @Nullable (comment this line inside class) ... }

  1. node_modules\react-native-boundary\android\src\main\java\com\eddieowens\services\BoundaryEventJobIntentService.java

// import android.support.annotation.NonNull; // import android.support.v4.app.JobIntentService; import androidx.annotation.NonNull; import androidx.core.app.JobIntentService;

  1. node_modules\react-native-boundary\android\src\main\java\com\eddieowens\RNBoundaryModule.java

// import android.support.annotation.NonNull; // import android.support.v4.app.ActivityCompat; import androidx.annotation.NonNull; import androidx.core.app.ActivityCompat;

techDPM commented 10 months ago

@harshit-kishor2 work for me, but for every change in the node module dir ,its force to do the all procces again ...