为了账号安全,请及时绑定邮箱和手机立即绑定

将.jar文件添加到项目的问题

将.jar文件添加到项目的问题

茅侃侃 2022-09-01 16:41:55
添加了两个自定义zxing和zbar库,用于通过File>New>Jar.file添加它们,然后在项目结构中也添加了它们,并在所有已经打开的问题中使用了编译,但在Android Studio中,它不再是实现和api如何正确添加它们?build.gradle (app)apply plugin: 'com.android.application'check.dependsOn 'assembleDebugAndroidTest'android {compileSdkVersion 28flavorDimensions "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 GradleCompatibleimplementation '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 Authenticationimplementation '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'
查看完整描述

1 回答

?
繁星coding

TA贡献1797条经验 获得超4个赞

我建议从这里使用依赖项 https://mvnrepository.com/artifact/com.google.zxing 但是在你的情况下(只要你添加jar),你可以通过build.gradle(库被它们放入的任何文件夹替换)插入它们。implementation fileTree(include: ['*.jar'], dir: 'libs')



查看完整回答
反对 回复 2022-09-01
  • 1 回答
  • 0 关注
  • 89 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信