问题描述
我发现以下问题:
人们将其标记为重复(这是错误的!请参阅下一句)或者写了一些关于Maven或清理项目的内容等等。
我两天的问题完全相同(无法解析customtabs和support-v4),而且我之前没有更改过我的项目。所以我开始寻找可能的解决方案,并发现问题 - 这是OneSignal依赖 - 当我删除它时,一切正常。但是我已经在我的应用程序中实现了通知 - 并且现在不知道该怎么做。我试图编译最新的一个(在OneSignal页面上提到)
compile'com.onesignal:OneSignal:[3.6.0, 3.99.99)'
但结果是一样的。任何人都可以帮忙吗?
更新:
这个问题可以很容易地转载 - 请创建一个简单的项目添加下面提到的这种依赖关系(它来自官方OneSignal网站):
compile'com .onesignal:OneSignal:[3.6.0,3.99.99]'
更新2:
这些是我的依赖项:
compile'com.android.support:appcompat -v7:25.3.1'
compile'com.android.support.constraint:constraint-layout:1.0.2'
compile'com.google.firebase:firebase-auth:10.0.1'
编译'com.google.firebase:firebase-database:10.0.1'
编译'com.firebaseui:firebase-ui-database:1.1.0'
compile'com.android.support :design:25.3.1'
compile'com.onesignal:OneSignal:[3.6.0,3.99 .99]'
加入
maven {
urlhttps://maven.google.com
}
到build.gradle解决了OneSignal的问题,但现在我遇到了Firebase问题:
java.lang.NoSuchMethodError:没有静态方法zzdD(Ljava / lang / String;)类Lcom / google / android / gms / common / util / zzv中的Z;或其超类('com.google.android.gms.common.util.zzv'
发生错误是因为您的依赖项中存在一些冲突的库。 ,它表示:
你需要在你的项目中删除或使用相同的依赖项,如下所示:
compile'com.android.support:appcompat -v7:26.0。+'
compile'com.android.support.constraint:constraint-layout:1.0.2'
compile'com.google.firebase:firebase-auth:11.0。+'
compile'com.google.firebase:firebase-database:11.0。+'
compile'com.firebaseui:firebase-ui-database:1.1.0'
compile'com.android.support :design:26.0。+'
compile'com.onesignal:OneSignal:[3.6.0,3.99.99]'
I found the following question: Failed to resolve: com.android.support:customtabs:[26.0.0,26.1.0]People marked it as duplicate (which is wrong ! see next sentence) or wrote something about Maven or cleaning project etc.
I have exactly the same problem for two days (failed to resolve customtabs and support-v4) and I did not change anything in my project which has been previously working. So I started looking for possible solutions and I found the problem - it is the OneSignal dependency - when I remove it, everything works fine. But I have already implemented notifications in my app - and don't know what to do now. I tried to compile the newest one (mentioned on OneSignal page)
compile 'com.onesignal:OneSignal:[3.6.0,3.99.99)'
But the result is same. Can anyone help?
UPDATE:
The problem can be very easy reproduced - please create a simple project and add this dependency mentioned below (it is from official OneSignal website https://documentation.onesignal.com/v3.0/docs/android-sdk-setup):
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
UPDATE 2:
These are my dependencies:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-database:1.1.0'
compile 'com.android.support:design:25.3.1'
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
Adding
maven {
url "https://maven.google.com"
}
to the build.gradle solved the problem with OneSignal, but now I have a problem with Firebase:
java.lang.NoSuchMethodError: No static method zzdD(Ljava/lang/String;)Z in class Lcom/google/android/gms/common/util/zzv; or its super classes (declaration of 'com.google.android.gms.common.util.zzv'
The error happens because you have some conflicted library in your dependency.
As in the documentation, it says:
So, you need to remove or use the same dependencies in your project, something like this:
compile 'com.android.support:appcompat-v7:26.0.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.0.+'
compile 'com.google.firebase:firebase-database:11.0.+'
compile 'com.firebaseui:firebase-ui-database:1.1.0'
compile 'com.android.support:design:26.0.+'
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
这篇关于由于OneSignal,解决依赖关系失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!