skip to Main Content

I installed

logrocket/react-native 

and add to android/build.gradle

maven { url "https://storage.googleapis.com/logrocket-maven/" }

once all that is done i run my react native project on android but it keeps failing with this error

BUILD FAILED in 34s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':logrocket_react-native:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':logrocket_react-native:debugCompileClasspath'.
   > Could not find com.logrocket:logrocket:1.18.0.
     Required by:
         project :logrocket_react-native
  • tried to uninstall the nodemodule
  • tried to clear gradlew
  • increasing the logrocket/react-native version to 1.18.0, 1.19.0,1.19.2

this should have built and could yarn android built my app.

2

Answers


  1. Could not find com.logrocket:logrocket:1.18.0

    I think it means maven may not configured properly for logrocket.

    You can try by adding the following to the android/build.gradle

    allprojects {
      repositories {
          maven { url "https://storage.googleapis.com/logrocket-maven/" }
      }
    }
    

    It seems it’s ok to have multiple allprojects.repositories in the build.gradle

    Login or Signup to reply.
  2. I hit the same issue. My android/build.gradle already had:

    buildscript {
        // ...
        repositories {
            google()
            mavenCentral()
        }
    }
    

    and I initially added the maven { ... } line from the LogRocket docs to this block. But note that the top-level key here is buildscript, while the LogRocket docs specify allprojects. In my case, I was able to get it working by adding a whole new allprojects section to the end of my build.gradle:

    // ...
    
    allprojects {
        repositories {
            maven { url "https://storage.googleapis.com/logrocket-maven/" }
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search