0

I imported an existing Android project in the Android Studio but it does not build because of this :

Error:A problem occurred configuring project ':appName'.
> A problem occurred configuring project ':myTracksLib'.
   > Could not resolve all dependencies for configuration ':myTracksLib:_debugCompile'.
      > Could not find com.google.protobuf:protobuf-java:2.5.
        Searched in the following locations:
            https://jcenter.bintray.com/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.pom
            https://jcenter.bintray.com/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.jar
            file:/Users/name/Library/Android/sdk/extras/android/m2repository/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.pom
            file:/Users/name/Library/Android/sdk/extras/android/m2repository/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.jar
            file:/Users/name/Library/Android/sdk/extras/google/m2repository/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.pom
            file:/Users/name/Library/Android/sdk/extras/google/m2repository/com/google/protobuf/protobuf-java/2.5/protobuf-java-2.5.jar
        Required by:
            AppName:myTracksLib:unspecified

How can I solve that? Project builds in Eclipse so I do not know why this is happening.

I have seen this but I do not know how it related to Android Studio or not.

Community
  • 1
  • 1
ghostrider
  • 5,131
  • 14
  • 72
  • 120

1 Answers1

2

According to the search function of Maven Central:

http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.protobuf%22%20AND%20a%3A%22protobuf-java%22

There's a 2.5.0 version, not 2.5. Try changing the version in your build script to 2.5.0.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163