android– 如何安装域作为gradle依赖?

android– 如何安装域作为gradle依赖?,第1张

概述我对领域完全陌生.我想在我的android项目中使用realmdb.我已经通过官方Realmdocumentation.我需要在我的android项目中设置领域.为此,我已将gradle依赖性添加为buildscript{repositories{jcenter()}

我对领域完全陌生.我想在我的android项目中使用realm db.我已经通过官方Realm documentation.我需要在我的androID项目中设置领域.为此,我已将gradle依赖性添加为

    buildscript {            repositorIEs {                     jcenter()                         }            dependencIEs {                classpath "io.realm:realm-gradle-plugin:0.88.2"           }       } apply plugin: 'realm-androID'

这是他们在文档中给出的.但这对我不起作用.它给出了错误,说没有找到ID为’realm-androID’的插件.

这是我的build.gradle文件

apply plugin: 'com.androID.application'apply plugin: 'realm-androID'androID {compileSdkVersion 23buildToolsversion "23.0.2"defaultConfig {    applicationID "com.db.realmsample"    minSdkVersion 14    targetSdkVersion 23    versionCode 1    versionname "1.0"}buildTypes {    release {        MinifyEnabled false        proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'    }}buildscript {    repositorIEs {        jcenter()    }    dependencIEs {        classpath "io.realm:realm-gradle-plugin:0.88.2"    }  } } dependencIEs {  compile filetree(dir: 'libs', include: ['*.jar'])  testCompile 'junit:junit:4.12'  compile 'com.androID.support:appcompat-v7:23.2.1'  }

我的配置是否正确?

解决方法:

将buildscript移动到主build.gradle文件(Project),它不应该在build.gradle(module:app)中

buildscript {repositorIEs {    jcenter()  }dependencIEs {     classpath "io.realm:realm-gradle-plugin:<realm version>"   } }

这应该转到main build.gradle

总结

以上是内存溢出为你收集整理的android – 如何安装域作为gradle依赖?全部内容,希望文章能够帮你解决android – 如何安装域作为gradle依赖?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1096722.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存