gpt4 book ai didi

java - build.gradle 中出现意外 token : com. 旅程应用程序 :zxing-android-embedded:3. 4.0 @ 第 40 行,第 21 列错误

转载 作者:行者123 更新时间:2023-12-01 22:29:40 25 4
gpt4 key购买 nike

我正在按照教程在 android studio 中构建基于 android 的 QR 码扫描仪。但是,当我尝试在 build.gradle(app) 文件中实现 Zxing 时,出现错误显示:

意外的 token :com.journeyapps:zxing-android-embedded:3.4.0 @ 第 40 行,第 21 列。 实现'com.journeyapps:zxing-android-embedded:3.4.0'

这是 gradle.build 文件中的代码:

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'



implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
'com.android.support:appcompat-v7:25.0.1'
testImplementation 'junit:junit:4.12'

//add this dependency
Implementation'com.journeyapps:zxing-android-embedded:3.4.0'

}

最佳答案

正如日志中提到的,问题出在这一行,

实现'com.journeyapps:zxing-android-embedded:3.4.0'

替换为

实现“com.journeyapps:zxing-android-embedded:3.4.0”

更改在于实现关键字,实现关键字和依赖项名称之间必须恰好有一个空格。

关于java - build.gradle 中出现意外 token : com. 旅程应用程序 :zxing-android-embedded:3. 4.0 @ 第 40 行,第 21 列错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58553978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com