如何解决“错误:无法在存储库容器中为参数[]找到方法google()."在android studio 3.5中 [英] How to fix "ERROR: Could not find method google() for arguments [] on repository container." in android studio 3.5

查看:63
本文介绍了如何解决“错误:无法在存储库容器中为参数[]找到方法google()."在android studio 3.5中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从导入的android源代码构建和android项目;但是每次尝试构建时,都会得到此>>错误:在存储库容器中找不到用于参数[]的google()方法".我该如何解决

I am trying to build and android project from an imported android source code; but each time I try building, I get this >> "ERROR: Could not find method google() for arguments [] on repository container". How do I fix it

我最近通过goNative.io将Web应用程序转换为Native Android应用程序;其中它构建了一个apk,我可以将其安装在手机和android源代码上.在我的Android Studio中构建项目时,出现错误>>错误:无法在存储库容器中为参数[]找到google()方法".该错误被追溯到我的build.gradle.这是它的样子

I recently converted my Web Application to a Native android app via goNative.io; of which it built an apk I can install on my phone and the android source code. on building the project in my android studio, I get the error >> "ERROR: Could not find method google() for arguments [] on repository container". The bug was traced to my build.gradle. Here is what it looks like

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        //classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

我希望收到建立成功"消息,以便可以将我的API级别升级到28,然后重新构建为apk,以便最终可以在Google Play商店上发布.请帮助伙计们

I expected a "Build Successful" message so that I can upgrade my API Level to 28 the rebuild back to apk so that I can finally publish on google play store. Please help fellas

推荐答案

将gradle-wrapper.properties文件设置为:

set gradle-wrapper.properties file to:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

或更高

distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

这篇关于如何解决“错误:无法在存储库容器中为参数[]找到方法google()."在android studio 3.5中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆