如何在Anko中调试“无法解析com.google.android:android”错误
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" //Anko compile "org.jetbrains.anko:anko:$anko_version" compile "org.jetbrains.anko:anko-coroutines:$anko_version" compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version" compile 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.13' Build error: Error:Failed to resolve: Could not resolve com.google.android:android:2.3.1. Required by: project :app > org.jetbrains.kotlinx:kotlinx-coroutines-android:0.13
安装Android Studio 2.4 Preview时出现同样的错误。 只要确保你的项目级别的build.gradle看起来像这样
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.1.2-3' repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.1' //Version must be exactly 2.3.1 classpath 'com.google.gms:google-services:3.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }
删除线
compile "org.jetbrains.anko:anko-coroutines:$anko_version"
请再试一次。 或者粘贴完整的build.gradle。
maven {url'https: //maven.google.com '}至maven {url“ https://dl.google.com/dl/android/maven2/ ”}
- Kotlin扩展未解决的参考
- 使用Espresso的Android仪器测试失败:NoSuchMethodError javax.inject.Provider中的get()
- 是使用lateinit的最佳方式?
- 在Android应用程序中使用kotlin静态类似的方法
- 在Kotlin中使用AudioRecord读取函数与平台类型的参数不匹配
- 如何防止对话(警报)在您使用Anko触摸外部或后退时关闭
- 如何从里面引用lambda?
- 警告:警告:注释处理器“android.arch.lifecycle.LifecycleProcessor”支持的源版本“RELEASE_7”小于“源”1.8
- 无法在android studio中调用变量