DEV Community

Aashutosh Poudel
Aashutosh Poudel

Posted on

3 1

Fix "Could not find maven()" error in expo

I didn't have any issues building a development version of the app using expo. While running npx expo run:android I encountered an issue that something like this: "Could not find maven() for arguments ....".

The issue seems to be related to @rnmapbox/maps.
To resolve the issue make sure to add the following maven configs inside repositories in android/build.gradle.

repositories {

        maven {
            url 'https://maven.google.com/'
        }

        maven {
          url 'https://api.mapbox.com/downloads/v2/releases/maven'
          authentication { basic(BasicAuthentication) }
          credentials {
            username = 'mapbox'
            password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
          }
        }
}
Enter fullscreen mode Exit fullscreen mode

Versions:
Managed, config plugins + expo-dev-client

{
  // ...
  "expo": "~47.0.8",
  "react-native": "0.70.5",
  // ...
}
Enter fullscreen mode Exit fullscreen mode

References:

  1. Android Build Failure | Could not find method maven()
  2. Could not find method maven()
  3. RN 0.66 Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay