Error: Execution completed for task ': app: transformClassesWithFirebasePerformancePluginForRelease'

I cannot find the origin of this error when compiling in release mode. I was under the impression that this error appeared without changing my code (I'm trying to go back from github, but I still have this error).

Error: Execution completed for task ': Application: transformClassesWithFirebasePerformancePluginForRelease'.

java.io.IOException: The specified path was not found

Gradle with debug flag

22: 36: 11.767 [ERROR] [FirebasePerformancePlugin] Unable to execute command org / apache / xmlbeans / impl / schema / SchemaTypeSystemCompiler.class

My build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        maven {
            url 'https://maven.google.com'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'http://www.idescout.com/maven/repo/'
        }
        maven {
            url 'https://maven.google.com'
        }
    }
}

      

My app /build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

android {

    compileSdkVersion 26
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId ""
        minSdkVersion 16
        targetSdkVersion 26
        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
            signingConfig signingConfigs.Keys
        }
        debug {
            signingConfig signingConfigs.Keys
        }
    }
    dexOptions {
        jumboMode = true
    }

    packagingOptions {
        pickFirst 'META-INF/*'
    }
}

repositories {
    jcenter()
}
repositories {
    maven { url "http://repo1.maven.org/maven2" }
    maven { url 'https://jitpack.io' }
    maven { url 'https://maven.fabric.io/public' }
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'com.android.support:appcompat-v7:26.0.0-beta2'
    compile 'com.android.support:support-v13:26.0.0-beta2'
    compile 'com.android.support:support-v4:26.0.0-beta2'
    compile 'com.android.support:design:26.0.0-beta2'
    compile 'com.android.support:recyclerview-v7:26.0.0-beta2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:cardview-v7:26.0.0-beta2'
    compile 'com.android.support:customtabs:26.0.0-beta2'

    //firebase
    compile 'com.google.firebase:firebase-ads:11.0.2'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-messaging:11.0.2'
    compile 'com.google.firebase:firebase-auth:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'
    compile 'com.google.firebase:firebase-config:11.0.2'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    compile 'com.google.firebase:firebase-perf:11.0.2'
    compile 'com.firebaseui:firebase-ui-auth:1.2.0'

    //Fabric
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }


    compile 'com.android.support:support-vector-drawable:26.0.0-beta2'
    compile 'commons-io:commons-io:2.5'

    compile 'com.android.support:multidex:1.0.1'
    compile files('libs/aa-poi-ooxml-schemas-3.10-reduced-more-0.1.5.jar')
    compile files('libs/aa-poi-3.10-min-0.1.5.jar')
}

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

      

+11


source to share


2 answers


After migrating my Android project to Gradle Kotlin DSL, I also unexpectedly get an error Can't instrument

using the Firebase performance plugin for any project class including third party dependencies. The build eventually breaks off with OutOfMemoryError

. Mistake

Can't instrument: ...
java.lang.IllegalArgumentException
        at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
        at com.google.firebase.perf.plugin.instrumentation.InstrumentationVisitor.<init>(InstrumentationVisitor.java:55)
        ...

      

Looking at the ASM ClassVisitor source code I can see what getsIllegalArgumentException

added to the constructor when the raw version of the API is passed. perf-plugin requires version 7.0 ASM. However, while checking the project dependencies with ./gradlew :app:dependencies

, I found that ASM version 6.0 was used. Obviously some other dependencies require 6.0.

I tried to explicitly overwrite the ASM dependency with

configurations.all {
    resolutionStrategy.eachDependency {
        if (requested.group == "org.ow2.asm") {
            useVersion("7.0")
            because("Version required by Firebase Performance Plugin")
        }
    }
}

      



and in the output ./gradlew :app:dependencies

I can now see that 7.0 is being used, but I still get this error :(

Update: Downgrading com.google.firebase:firebase-plugins

from 1.2.0

to 1.1.5

solves the problem for me.

Update 2: Since version 2.0.0 firebase-plugins

its use is deprecated . The recommended solution is to use the Performance Monitoring plugin explicitly.After switching to a new plugin, the problem is now resolved for me.

Update 3: I have to revoke my previous expression. Using the Performance Monitor plugin fixed the build on my local machine, but not on my Jenkins build server. Also moving the block configurations.all

mentioned above to the block buildscript

, as Antimonit commented, did not fix the build, although I can see in the output ./gradlew buildEnvironment

that ASM 7.0 is being used for the build.

+6


source


Reason : when the classpath dependency on is perf-plugin

defined in the build.gradle

level file build.gradle

instead of the build.gradle

level file build.gradle

, perf-plugin

(at runtime) gets ASM v6 dep, even if the ASM V7 Dep POM file is declared in it. This throws an IllegalArgumentException in and because they depend on ASM v7, however it works great for because it depends on ASM v6 .perf-plugin

v1.2.0

v1.2.1

v1.1.5

There are tons of posts here explaining why the buildscript top-level classpath is intended to be different from the rest of the project:




Solution: this is gradle behavior. A quick solution to this problem is to define the dependency perf-plugin

only in the root project build.gradle

(which has already been mentioned in the open documents ).




Detailed explanation:

No mistakes

root project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.firebase:perf-plugin:1.2.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

      

app level build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'


. . .

dependencies {
    implementation 'com.google.firebase:firebase-perf:17.0.2'
}

      




BUG

root project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

      

app level build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.google.firebase:perf-plugin:1.2.1'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'


. . .

dependencies {
    implementation 'com.google.firebase:firebase-perf:17.0.2'
}

      




Comparing the command $./gradlew clean :buildEnvironment

in both cases shows that all references to are org.ow2.asm:asm:6.0

converted org.ow2.asm:asm:7.0

in case of absence, org.ow2.asm:asm:7.0

but this was not the case in case of an error :

No mistakes

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

.  .  .

    +--- com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
|    |    +--- org.ow2.asm:asm:6.0 -> 7.0
|    |    +--- org.ow2.asm:asm-util:6.0 (*)
|    |    +--- org.ow2.asm:asm-commons:6.0 (*)
|    |    +--- org.jdom:jdom2:2.0.6
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.0 -> 1.3.31 (*)
|    |    \--- com.android.tools.build.jetifier:jetifier-core:1.0.0-beta04 (*)
|    +--- com.google.protobuf:protobuf-java:3.4.0
|    \--- com.google.protobuf:protobuf-java-util:3.4.0 (*)
\--- com.google.firebase:perf-plugin:1.2.1
     \--- org.ow2.asm:asm:7.0

      

BUG

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

.  .  .

     +--- com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
     |    +--- org.ow2.asm:asm:6.0
     |    +--- org.ow2.asm:asm-util:6.0 (*)
     |    +--- org.ow2.asm:asm-commons:6.0 (*)
     |    +--- org.jdom:jdom2:2.0.6
     |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.0 -> 1.3.31 (*)
     |    \--- com.android.tools.build.jetifier:jetifier-core:1.0.0-beta04 (*)
     +--- com.google.protobuf:protobuf-java:3.4.0
     \--- com.google.protobuf:protobuf-java-util:3.4.0 (*)

      

+1


source







All Articles