我正在尝试在我的Android应用中使用Pocketsphinx,这给我带来了麻烦。我已经按照此处概述的方式安装了它:PocketSphinx on Android,特别是通过导入.aar。这是我的代码:
project build.gradle文件:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.android.tools.build:gradle:3.2.1'
//classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
应用程序build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "kutz.connor.Aware"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
DexOptions {
matchingFallbacks = ['debug', 'release']
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'org.tensorflow:tensorflow-lite:+'
implementation project(':aars')
}
apply plugin: 'com.google.gms.google-services'
我得到的错误是
ERROR: Unable to resolve dependency for ':Aware@debug/compileClasspath': Could not resolve project :aars.
ERROR: Unable to resolve dependency for ':Aware@debugAndroidTest/compileClasspath': Could not resolve project :aars.
ERROR: Unable to resolve dependency for ':Aware@debugUnitTest/compileClasspath': Could not resolve project :aars.
当我尝试构建项目时。经过研究,我发现这可能与将Androdi Studio更新到3.0有关。
我尝试过的一些解决方案:
添加matchFallbacks进行调试,并在build.gradle函数中发布
为项目创建settings.gradle
任何帮助都会很棒。我在帖子中也看到过将所有构建类型也都移至应用gradle的功能,但是我不确定该怎么做。
编辑
这是项目文件夹中的settings.gradle文件,只有一行
include ':Aware', ':aars'