简体   繁体   English

错误:无法在Android Studio导入的项目中找到:com.google.protobuf:protobuf-java:2.5

[英]Error:Failed to find: com.google.protobuf:protobuf-java:2.5 in Android Studio imported project

I imported an existing Android project in the Android Studio but it does not build because of this : 我在Android Studio中导入了现有的Android项目,但由于以下原因而无法构建:

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. 项目是在Eclipse中构建的,所以我不知道为什么会这样。

I have seen this but I do not know how it related to Android Studio or not. 我已经看到了,但是我不知道它与Android Studio有什么关系。

According to the search function of Maven Central: 根据Maven Central的搜索功能:

http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.protobuf%22%20AND%20a%3A%22protobuf-java%22 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. 有一个2.5.0版本,而不是2.5。 Try changing the version in your build script to 2.5.0. 尝试将构建脚本中的版本更改为2.5.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio和protobuf错误:(7,0)找不到ID为'com.google.protobuf'的插件 - Android Studio and protobuf Error:(7, 0) Plugin with id 'com.google.protobuf' not found 如何在完整的Android项目(渐变)中包含“ com.google.protobuf”,而不是精简的形式? - How do you include 'com.google.protobuf' on android project (gradle) as full but not as lite? Caused by: org.gradle.api.GradleException: 找不到满足版本约束的 'com.google.protobuf:protobuf-javalite' 版本: - Caused by: org.gradle.api.GradleException: Cannot find a version of 'com.google.protobuf:protobuf-javalite' that satisfies the version constraints: 带有 Android Studio 的 Protobuf - Protobuf with Android Studio Android studio和Protobuf集成 - Android studio and Protobuf integration Android中的Java Protobuf - NoClassDefFoundError - Java Protobuf in Android - NoClassDefFoundError Android Studio 无法构建 Google Protobuf 生成的文件 - Android Studio can't build Google Protobuf generated files com.google.protobuf.nano不存在 - com.google.protobuf.nano does not exist Google protobuf 可以用于android 中C 和Java 服务之间的通信吗? - Can Google protobuf be used for communication between C and Java services in android? 如何用android studio protobuf插件编译protobuf消息实现Parcelable? - how to compile protobuf message implement Parcelable with android studio protobuf plugin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM