简体   繁体   English

android 库错误

[英]android libraries errors

i am working on an android studio project, when i run the project it crashes immedietly, i tried to debug and i found that the problem is in the methods i use from the android libraries as in the pic here ( https://i.stack.imgur.com/a6bKI.png )我正在处理一个 android 工作室项目,当我运行该项目时它立即崩溃,我尝试调试并发现问题出在我从 android 库中使用的方法中,如图所示( https://i. stack.imgur.com/a6bKI.png

i updated the android SDK repaired the IDE added the depencencies needed to the build.gradle file but the problem is not solved我更新了 android SDK 修复了 IDE 添加了 build.gradle 文件所需的依赖项但问题没有解决

bellow is the build.gradle下面是 build.gradle

plugins {
    id 'com.android.application'
}

android {
    namespace 'com.example.readerapp'
    compileSdk 33

    defaultConfig {
        applicationId "com.example.readerapp"
        minSdk 21
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            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.5.1'
    implementation "androidx.annotation:annotation:1.5.0"
    implementation "androidx.constraintlayout:constraintlayout:2.1.4"
    implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
    implementation 'com.google.android.material:material:1.5.0'
    implementation files('libs\\uhfcom13_eu_v15.jar')
    implementation files('libs\\SerialPort.jar')
}

Go To: File->Invalidate Caches-> Rebuild Project Go To: File->Invalidate Caches-> Rebuild Project

I faced the same issue and that fixed my problem.我遇到了同样的问题,这解决了我的问题。

implementation files('libs\\uhfcom13_eu_v15.jar')
implementation files('libs\\SerialPort.jar')

Replace with:用。。。来代替:

implementation files('libs\uhfcom13_eu_v15.jar')
implementation files('libs\SerialPort.jar')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM