我是非常新的android并尝试firebase我正在尝试firebase auth和firebase数据库.
我可以成功完成auth功能,下面是app模块的gradle文件内容.
apply plugin: 'com.androID.application'androID { compileSdkVersion 24 buildToolsversion "24.0.3" defaultConfig { applicationID "com.cirvi.laxmimobileshopee" minSdkVersion 15 targetSdkVersion 24 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner" } buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' } }}dependencIEs { compile filetree(dir: 'libs', include: ['*.jar']) androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.androID.support', module: 'support-annotations' }) compile 'com.androID.support:appcompat-v7:24.2.1' compile 'com.androID.support:design:24.2.1' compile 'com.androID.support:support-v4:24.2.1' compile 'com.androID.support:recyclervIEw-v7:24.2.1' compile "com.Google.firebase:firebase-auth:9.0.2" testCompile 'junit:junit:4.12'}apply plugin: 'com.Google.gms.Google-services'
现在,对于下一步,我想在同一个项目中使用firebase数据库,并通过添加依赖项来更新gradle文件
compile 'com.Google.firebase:firebase-database:9.6.1'
一旦我这样做并开始同步我得到以下错误
information:Gradle tasks [:app:generateDeBUGSources, :app:generateDeBUGAndroIDTestSources, :app:mockableAndroIDJar, :app:prepareDeBUGUnitTestDependencIEs]Error:Execution Failed for task ':app:processDeBUGGoogleServices'.> Please fix the version conflict either by updating the version of the Google-services plugin (information about the latest version is available at https://bintray.com/androID/androID-tools/com.Google.gms.Google-services/) or updating the version of com.Google.androID.gms to 9.6.1.information:BUILD Failedinformation:Total time: 2.86 secsinformation:1 errorinformation:0 warningsinformation:See complete output in console
下面是我的项目gradle文件的代码.
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositorIEs { jcenter() } dependencIEs { classpath 'com.androID.tools.build:gradle:2.2.0' classpath 'com.Google.gms:Google-services:3.1.0' // NOTE: Do not place your application dependencIEs here; they belong // in the indivIDual module build.gradle files }}allprojects { repositorIEs { jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
我尝试更新项目gradle文件中的Google服务版本,但后来遇到了其他问题.由于我是AndroID的新手,并尝试了一些事情,我陷入困境,目前无法弄清楚如何解决这个问题.任何人都可以指导我或帮助我吗?
解决方法:
试试这个
转到项目级build.gradle&检查它是否看起来像这样:
allprojects { repositorIEs { jcenter() maven { url "https://maven.Google.com" } }}
为两者设置相同的依赖
implementation "com.Google.firebase:firebase-auth:9.6.1"implementation 'com.Google.firebase:firebase-database:9.6.1'
总结 以上是内存溢出为你收集整理的如何在android for Firedle for gradle中为数据库和auth一起添加依赖项?全部内容,希望文章能够帮你解决如何在android for Firedle for gradle中为数据库和auth一起添加依赖项?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)