mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 559 forks source link

:@hariks789_react-native-background-geolocation-common:compileReleaseJavaWithJavac'. > Compilation failed; see the compiler error output for details. #582

Open Nirmal-cod opened 11 months ago

Nirmal-cod commented 11 months ago

Your Environment

buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33

Context

:@hariks789_react-native-background-geolocation-common:compileReleaseJavaWithJavac'. > Compilation failed; see the compiler error output for details. got this error..

Expected Behavior

wanted to build app

Actual Behavior

problem in build

Possible Fix

Steps to Reproduce

1. 2. 3. 4.

Context

Debug logs

Nirmal-cod commented 11 months ago

Task :hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars FAILED

FAILURE: Build failed with an exception.

Nirmal-cod commented 11 months ago

@hariks789

Nirmal-cod commented 11 months ago

Task :hariks789_react-native-background-geolocation:packageDebugResources FAILED

lahed commented 8 months ago

same, @Nirmal-cod you fixed??

hariks789 commented 8 months ago

@Nirmal-cod @lahed Sorry, I am no longer maintaining the package. We started using the paid package for the app.

This fork from @mak12 might help you guys https://github.com/mak12/react-native-background-geolocation

mohanrajrajamani commented 3 months ago

Task :hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars FAILED

FAILURE: Build failed with an exception.

  • What went wrong: A problem was found with the configuration of task ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' (type 'LibraryJniLibsTask').

    • Gradle detected a problem with the following location: '/Users/nirmal/rioapp/node_modules/@hariks789/react-native-background-geolocation/android/lib/build/intermediates/stripped_native_libs/release/out'. Reason: Task ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' uses this output of task ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Possible solutions:
    1. Declare task ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' as an input of ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars'.
    2. Declare an explicit dependency on ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' from ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' using Task#dependsOn.
    3. Declare an explicit dependency on ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' from ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' using Task#mustRunAfter

I think your settings.gradle file like this.

include ':@hariks789_react-native-background-geolocation-common' project(':@hariks789_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/common') include ':@hariks789_react-native-background-geolocation' project(':@hariks789_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/lib')

Remove the two lines .

include ':@hariks789_react-native-background-geolocation' project(':@hariks789_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/lib')

Use this line only. It is working

include ':@hariks789_react-native-background-geolocation-common' project(':@hariks789_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/common')

But we using alternate package. That package also I got same error. After remove the lines working fine.

https://www.npmjs.com/package/@drewaker/react-native-background-geolocation

Inayat567 commented 3 months ago

Task :hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars FAILED

FAILURE: Build failed with an exception.

  • What went wrong: A problem was found with the configuration of task ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' (type 'LibraryJniLibsTask').

    • Gradle detected a problem with the following location: '/Users/nirmal/rioapp/node_modules/@hariks789/react-native-background-geolocation/android/lib/build/intermediates/stripped_native_libs/release/out'. Reason: Task ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' uses this output of task ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Possible solutions:
    1. Declare task ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' as an input of ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars'.
    2. Declare an explicit dependency on ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' from ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' using Task#dependsOn.
    3. Declare an explicit dependency on ':@hariks789_react-native-background-geolocation:stripReleaseDebugSymbols' from ':hariks789_react-native-background-geolocation:copyReleaseJniLibsProjectAndLocalJars' using Task#mustRunAfter

I think your settings.gradle file like this.

include ':@hariks789_react-native-background-geolocation-common' project(':@hariks789_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/common') include ':@hariks789_react-native-background-geolocation' project(':@hariks789_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/lib')

Remove the two lines .

include ':@hariks789_react-native-background-geolocation' project(':@hariks789_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/lib')

Use this line only. It is working

include ':@hariks789_react-native-background-geolocation-common' project(':@hariks789_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@hariks789/react-native-background-geolocation/android/common')

But we using alternate package. That package also I got same error. After remove the lines working fine.

https://www.npmjs.com/package/@drewaker/react-native-background-geolocation

Thanks

You saved my time

  include ':@mauron85_react-native-background-geolocation-common'
  project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/common')

worked for me