Could not find method google() for arguments [] on repository container.

2020-05-13 09:56:35

参考地址 Could not find method google() for arguments [] on repository container.

问题:

在react native中安装realm数据库后运行react-native run-android 时报如下错:




开发环境:


react-native:^0.55.4


reaml:^2.27.0


解决方案:

1、打开项目根目录下android/gradle/wrapper/gradle-wrapper.properties


将distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip中的2.14.1改成4.1




2、打开项目根目录下的android/build.gradle


1)、在buildscript和allprojects下的repositories分别添加google()


2)、将dependencies中的classpath 'com.android.tools.build:gradle:2.2.3'中的2.2.3【具体看自己的是多少】改成3.0.1




重新运行编译项目命令,要下载新的gradle,这个过程有点慢。至此,问题已解决!



  • 2019-10-30 00:33:15

    Mac 查看本机ip地址

    记住看好下面,查询mac的本机地址是ifconfig而不是ipconfig,windows才是ipconfig,虽然不知道if是啥意思。

  • 2019-10-30 13:25:17

    mybatis foreach标签详解,逗号,and还有or,留一个

    查询数据库中文章的相关文章 文章为一个表 字段tags为相关文章字符串中间用','逗号进行啦分割 查询完一个文章后可以把tags字段构造为一个List<String> 然后利用这个集合作为条件来查询

  • 2019-11-04 02:12:42

    genymotion免费版

    genymotion是一套完整的android虚拟环境工具,相对官方android sdk,它的安装和使用简洁方便不臃肿,但是现在genymotion官方网站不再提供个人的下载,这篇博客记录了如何下载和使用genymotion个人版.