【发布时间】:2021-08-31 14:44:28
【问题描述】:
我是 android studio 的初学者,所以我下载了这段代码并想在上面添加身份验证,为此我创建了一个新包“com.example.authapp”。
所以当我尝试连接到 firebase 时,我收到以下错误:
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.
所以我想知道我应该在我的 gradles 中添加一些东西吗?
我的 gradles 的内容: 1/build.gradle(app)
apply plugin: 'com.android.application'
repositories {
google()
maven {
url 'https://alphacephei.com/maven/'
}
}
android {
compileSdkVersion 29
defaultConfig {
applicationId "org.vosk.demo"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.1"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'net.java.dev.jna:jna:5.8.0@aar'
implementation group: 'com.alphacephei', name: 'vosk-android', version: '0.3.23'
implementation project(':models')
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
}
2/build.gradle(模型)
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
buildFeatures {
buildConfig = false
}
sourceSets {
main {
assets.srcDirs += "$buildDir/generated/assets"
}
}
}
tasks.register('genUUID') {
def uuid = UUID.randomUUID().toString()
def odir = file("$buildDir/generated/assets/model-en-us")
def ofile = file("$odir/uuid")
doLast {
mkdir odir
ofile.text = uuid
}
}
preBuild.dependsOn(genUUID)
3/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
请帮助我,我应该怎么做才能连接到 Firebase?
【问题讨论】:
标签: java android firebase gradle