简体   繁体   中英

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 )

i updated the android SDK repaired the IDE added the depencencies needed to the build.gradle file but the problem is not solved

bellow is the 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

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')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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