Gradle 文件:
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion '27.0.1'
它在其他 Windows 机器上运行完美,但在这台计算机上它给出了这个错误:Error:Module 'app': platform 'Google Inc.:Google APIs:23' not found。
我需要使用 Google APIs:23
而不是 SDK 23
进行编译,因为我正在使用 Google APIs 附加组件中的一些东西。
我检查过 Stack Overflow 中的一些解决方案告诉你可以避免这个问题,将我的 Gradle 文件更改为 compileSdkVersion 23
,但这不是一个好的解决方案,因为如果你这样做,你就不会编译使用 Google API 插件。
AndroidStudios 和 AndroidSDK 在两台机器上都已完全更新,所以我不明白为什么我只在其中一台机器上收到此错误。
最佳答案
我终于让它工作了。
- 将您的行从 compileSdkVersion
'Google Inc.:Google APIs:23'
重命名为compileSdkVersion 23
- 构建项目,它应该可以工作(但可能没有 google api 附加组件)
- 再次将您的行从
compileSdkVersion 23
重命名为'Google Inc.:Google APIs:23'
。 - 构建项目。
- 如果它不起作用,请尝试从命令行工具
sdkmanager
下载 Google APIs:23 插件并重复该过程。
关于android - 错误 :Module 'app' : platform 'Google Inc.:Google APIs:23' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47694833/