Я хочу создать приложение android, которое может сканировать QR-код. Затем я скачал библиотеку zxing из https://github.com/journeyapps/zxing-android-embedded и разархивировал ее после распаковки. Я последовал многим ответам, таким как Редактирование внешних библиотек в Android Studio , но у меня ничего не получалось. Это ошибка, которую я получаю после прохождения всех процедур, таких как создание папки subProject и вставка в нее папки, встроенной в zxing. Затем я отредактировал мой build.gradle
файл, добавив его в раздел «зависимости»:
dependencies {
//...
implementation project(path: ':subProject:zxing-android-embedded',configuration :'default')
}
Затем я отредактировал setting.gradle
файл и добавил include ':app',':subProject:zxing-android-embedded'
Все еще получаю ошибку, я не знаю почему я использовал
implementation 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
implementation 'com.google.zxing:core:3.2.0'
ранее, это работало для меня, но затем мне нужно было внести изменения в некоторые файлы классов библиотеки zxing, поэтому я импортировал библиотеку. Вот некоторые файлы с кодом
build.gradle(Module:app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.qrcodefirebase"
minSdkVersion 16
targetSdkVersion 29
versionCode 2
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
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:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':subProject:zxing-android-
embedded',configuration :'default')
apply plugin: 'maven'//classpath "com.jfrog.bintray.gradle:gradle-
bintray-plugin:1.7.3"
implementation 'com.google.firebase:firebase-database:19.2.1'
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
}
android {
buildToolsVersion '28.0.3'
}
build.gradle(Project:QrcodeFirebase)
// Top-level build file where you can add configuration options
common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
}
allprojects {
repositories {
google()
mavenCentral()
center()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle (Настройки проекта)
include ':app',':subProject:zxing-android-embedded'
А также я получаю сообщение об ошибке внутри Main Activity, которое связано с классом intentintegraor и не может использовать это к их проекту. Может ли кто-нибудь помочь мне с этим? Заранее спасибо