使用AndroidStudio在AVD上运行出错:com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line 1 column 29 path $[0]
解决方法:把项目中build.gradle文件中的dependencies下的gradle版本号从3.3.1改为3.2.0.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
改完后需要重新下载一些东西,可能会比较慢。亲测该方法有效。
但是有一个小问题:为什么不改依然可以打包成APK并在手机上运行,而是用AVD时不改就无法运行。