因为最近需要在Android平台中进行人脸识别和声纹识别需求,所以选择了科大讯飞的开放平台的相关服务的SDK,在下载成功后里面的情况如下图所示:
目的:导入sample File–>New—>Import Project–>选择sample文件里的speechDemo项目
这时会提示
gradle 未配置的提示框如下图:
Gradle settings for this project are not configured yet.
Would you like the project to use the Gradle wrapper?
(The wrapper will automatically download the latest supported Gradle version).
Click 'OK' to use the Gradle wrapper, or 'Cancel' to manually set the path of a local Gradle distribution.
解决方式:点击cancel 选项手动配置gradle路径
这里的gradle路径是在你安装的Android studio路径下的gradle文件夹里面。
编译会报错:
Plugin with id 'com.android.application' not found
在gradle 中添加如下代码(注意此时导入的项目只有一个gradle文件):
使用下面的代码:
buildscript{
repositories{
jcenter()
}
dependencies{
classpath "com.android.tools.build:gradle:2.3.3"
}
}
如果在模拟器上运行会报错:
Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS......
如果是模拟器的话编译运行会报错(如果此时使用真机就不会报错,这主要原因是真机和模拟器的架构不一样导致的,此时要么使用真机调试,要么在gradle配置下架构请自行百度):