glaston123
glaston123

Reputation: 25

Unknown error: java.lang.IllegalArgumentException: !directory.isDirectory()

I just tried to rebuild my project having changed nothing and I am getting an unknown error which I cannot seem to resolve.

I have tried to clean the project and rebuild the project, as well as restarting Android Studio but nothing is working. The error also points out that certain features are deprecated however this has not stopped the app from working perfectly 10 minutes ago.

Error Returned:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> 1 exception was raised by workers:
  java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: !directory.isDirectory()


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 7s
31 actionable tasks: 28 executed, 3 up-to-date

With stack trace:


0:15:15.045 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
00:15:15.045 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
00:15:15.045 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
00:15:15.046 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
00:15:15.046 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:packageDebug'.
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > 1 exception was raised by workers:
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   java.lang.IllegalArgumentException: !directory.isDirectory()
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
00:15:15.047 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org


app-level gradle file:


apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.camerakitqr"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'



    //androidTestImplementation 'com.android.support.test:runner:1.0.2'
    //androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-ml-vision:20.0.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.karumi:dexter:5.0.0'
    implementation 'com.android.support:design:28.0.0'


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


Upvotes: 1

Views: 1202

Answers (1)

Taseer
Taseer

Reputation: 3502

Add this in your app-level Gradle file.

compileOptions {
  sourceCompatibility JavaVersion.VERSION_1_8
  targetCompatibility JavaVersion.VERSION_1_8
}

Upvotes: 2

Related Questions