1

I am facing an error while building an android app with react-native, If anyone has an idea then help me out.

Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.google.protobuf:protobuf-javalite:{strictly [3.0, 4.0[}.
     Required by:
         project :app > project :logrocket_react-native
      > Cannot find a version of 'com.google.protobuf:protobuf-javalite' that satisfies the version constraints:

This is my logrocket version:

"@logrocket/react-native": "1.6.2",
Jatin Bhuva
  • 1,301
  • 1
  • 4
  • 22

6 Answers6

1

I spoke with LogRocket support about this and they just got back and said they've released version 1.11.1 which tightens up the dependency on protobuf and fixes this. Release notes here: https://docs.logrocket.com/docs/mobile-sdk-changelog#1111-2023-01-31

stuckj
  • 977
  • 1
  • 13
  • 24
1

It seems like that version is broken. There needs to be someone on their team to fix their dependency, but on the meantime you can override the version of protobuf-javalite that it is using.

Our team has found a hotfix open /node_modules/@logrocket/react-native/android/build.gradle

and make this changeenter image description here

        version {
            strictly '[3.0, 21['
        }
    }
Jmz
  • 159
  • 7
0

Just started getting the same issue on native Android today.

Could not resolve com.google.protobuf:protobuf-javalite:{strictly [3.0, 4.0[; prefer 3.19.1}. Required by: project :app > com.logrocket:logrocket:1.11.0 > Could not resolve com.google.protobuf:protobuf-javalite:3.22.0-RC1. > Could not parse POM https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-javalite/3.22.0-RC1/protobuf-javalite-3.22.0-RC1.pom > Could not find com.google.protobuf:protobuf-parent:3.22.0-RC1.

Tried upping and downgrading logrocket version, checking out a commit in my project from when it was still working, etc, but it's still bugged. Seems like an issue from logrocket.

M.Ed
  • 969
  • 10
  • 12
  • can you please tell me earlier which version you were using? – Jatin Bhuva Jan 31 '23 at 09:17
  • We were at version 1.10.1 when it used to work yesterday, according to the docs the newest version is 1.11.0, neither of them are compiling successfully. – M.Ed Jan 31 '23 at 09:21
  • The same thing happened to me also I am using the 1.6.2 version yesterday it was fine but today this issue is coming. – Jatin Bhuva Jan 31 '23 at 09:22
  • I didn't change anything related to npm libraries or native android, Yesterday I just changed styles in code, and today, when I am building or generating APK this error, is throwing to me. After comment out logrocket, the project is working. – Jatin Bhuva Jan 31 '23 at 09:29
  • Let me know if you found anything. – Jatin Bhuva Jan 31 '23 at 09:31
  • 1
    Affecting us too. I just hit up their support to see if they have a solution (or even know about the issue). – stuckj Jan 31 '23 at 17:46
  • 1
    They responded back pretty quickly. They determined it's a widespread issue with protobuf in general (see here: https://github.com/protocolbuffers/protobuf/issues/11719#issuecomment-1410586339). They're working on a fix to mitigate the issue. – stuckj Jan 31 '23 at 17:57
0

Yea, tried setting protobuf version between 3.0 to 4.0, cleared cache, re-built the app, still no luck. Disabled log-rocket for now, till a solution is found.

0

Caused by protobuf issue: https://github.com/protocolbuffers/protobuf/issues/11719

For anyone affected by this due to the LogRocket SDK, the LogRocket team has stated that they are attempting to mitigate the issue from their side.

merchang
  • 1
  • 2
0

I was also facing the same issue from past one day. Changing the version strictly [3.0, 4.0[ to strictly '3.19.1'in Firebase in Nodemodules->logRocket->android->build.gradle and creating a patch package for it worked for me now.