不支持的方法:BaseConfig.getApplicationIdSuffix() [英] Unsupported method: BaseConfig.getApplicationIdSuffix()

查看:405
本文介绍了不支持的方法:BaseConfig.getApplicationIdSuffix()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在阅读面向程序员的Android 6:一种应用程序驱动方法,而前两个应用程序示例与这些示例都没有问题,这一次是在Android Studio 3.0中加载后的FlagQuiz示例Canary-3我收到此错误,但该错误使我无法构建项目:

So I'm reading Android 6 for Programmers: An App-Driven Approach and the first two app examples I had no issues with the examples, this time the FlagQuiz example when loaded in Android Studio 3.0 Canary-3 I'm getting this error which isn't letting me build the project:

错误:不支持的方法:BaseConfig.getApplicationIdSuffix(). 您连接到的Gradle版本不支持该方法. 要解决该问题,您可以更改/升级您连接到的Gradle的目标版本. 另外,您可以忽略此异常并从模型中读取其他信息.

Error:Unsupported method: BaseConfig.getApplicationIdSuffix(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you connect to. Alternatively, you can ignore this exception and read other information from the model.

您可以从图书网站此处下载源代码使用我正在测试的相同代码库进行测试.

You can download the source from the book site here to test with the same code base that I'm testing from.

推荐答案

好的,我想出了解决此问题的方法.

Alright I figured out how to fix this issue.

  • 打开build.gradle并将gradle版本更改为推荐版本:
    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'com.android.tools.build:gradle:2.3.2'
  • 'Try Again'
  • 在消息框中将显示'Fix Gradle Wrapper and re-import project'单击该内容,因为最低gradle版本是3.3
  • 将弹出一个新错误并提示The SDK Build Tools revision (23.0.1) is too low for project ':app'. Minimum required is 25.0.0-按下Update Build Tools version and sync project
  • 可能会弹出一个显示Android Gradle Plugin Update recommended的窗口,只需从那里进行更新即可.
  • Open build.gradle and change the gradle version to the recommended version:
    classpath 'com.android.tools.build:gradle:1.3.0' to
    classpath 'com.android.tools.build:gradle:2.3.2'
  • Hit 'Try Again'
  • In the messages box it'll say 'Fix Gradle Wrapper and re-import project' Click that, since the minimum gradle version is 3.3
  • A new error will popup and say The SDK Build Tools revision (23.0.1) is too low for project ':app'. Minimum required is 25.0.0 - Hit Update Build Tools version and sync project
  • A window may popup that says Android Gradle Plugin Update recommended, just update from there.

现在该项目现在应该可以在您的任何Android虚拟设备上运行了.

Now the project should be runnable now on any of your android virtual devices.

这篇关于不支持的方法:BaseConfig.getApplicationIdSuffix()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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