1

Добавлены две пользовательские библиотеки zxing и zbar для чтения и генерации штрих-кодов, через File>New> Jar.файл, добавил их, после в Project Structure тоже добавил их и выбрал implementation во всех уже открытых вопросах используется compile, но в Android studio этого уже нет вместо нее implements и api как их правильно добавить?

build.gradle (app)

apply plugin: 'com.android.application'
check.dependsOn 'assembleDebugAndroidTest'

android {
compileSdkVersion 28
flavorDimensions "minSdkVersion"

defaultConfig {

    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
'android.support.test.runner.AndroidJUnitRunner'
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}

compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}
}

configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:28.0.0'
}

dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
// Firebase Authentication
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso- 
   core:3.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation project(':zbar')
implementation project(':zxing_core')
}

apply plugin: 'com.google.gms.google-services'

build.gradle(project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
    mavenLocal()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.2'
    classpath 'com.google.gms:google-services:4.2.0'
}
  }

allprojects {
repositories {
    mavenLocal()
    jcenter()
    google()
    maven { url 'https://maven.fabric.io/public' }
}
  }

  task clean(type: Delete) {
delete rootProject.buildDir
 }
2
  • Судя по .apk это Android приложение или нет? Чем собираешь проект? Как подключал библиотеки в коде? Выложи текст.
    – Inwar2006
    25 мар 2019 в 18:28
  • про апргрейдил вопрос 25 мар 2019 в 18:53

1 ответ 1

0

Лучше добавлять пользовательские библиотеки с помощью Maven Repository, так Gradle сам все выкачивает куда надо. В dependencies приложения надо добавить строку compile group: 'путь', name: 'имя', version: 'версия', например compile group: 'com.yanzhenjie.zbar', name: 'zbar', version: '1.0.0' для https://mvnrepository.com/artifact/com.yanzhenjie.zbar/zbar/1.0.0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.