skip to Main Content

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

2

Answers


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

    I faced the same issue and that fixed my problem.

    Login or Signup to reply.
  2. implementation files('libs\uhfcom13_eu_v15.jar')
    implementation files('libs\SerialPort.jar')
    

    Replace with:

    implementation files('libsuhfcom13_eu_v15.jar')
    implementation files('libsSerialPort.jar')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search