错误:任务':app:transformClassesWithFirebasePerformancePluginForRelease'的执行失败 [英] Error:Execution failed for task ':app:transformClassesWithFirebasePerformancePluginForRelease'

查看:91
本文介绍了错误:任务':app:transformClassesWithFirebasePerformancePluginForRelease'的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在发布模式下编译时,找不到此错误的根源.我的印象是,此错误未修改我的代码就出现了(我尝试回溯到github,但仍然有此错误).

I can not find the origin of this error when I compile in release mode. I have the impression that this error appeared without modifying my code (I try to go back with github but I still have this error).

错误:任务执行失败 ':app:transformClassesWithFirebasePerformancePluginForRelease'.

Error:Execution failed for task ':app:transformClassesWithFirebasePerformancePluginForRelease'.

java.io.IOException:找不到指定的路径

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

带有调试标志的分级

22:36:11.767 [错误] [FirebasePerformancePlugin]无法检测org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.class

22:36:11.767 [ERROR] [FirebasePerformancePlugin] Can't instrument org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.class

我的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'
        }
    }
}

我的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'

推荐答案

将我的Android项目迁移到Gradle Kotlin DSL之后,我突然还收到了 any 类的Firebase Performance Plugin收到的Can't instrument错误.项目,包括第三方依赖项.该构建最终会以OutOfMemoryError中止.错误是

After migrating my Android project to Gradle Kotlin DSL I suddenly also receive the Can't instrument error by the Firebase Performance Plugin for any class of the project, including third-party dependencies. The build eventually aborts with an OutOfMemoryError. The error is

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

查看ASM的 perf-plugin 需要ASM 7.0版.但是,当使用./gradlew :app:dependencies检查项目依赖项时,我发现使用的是ASM 6.0版本.显然,某些其他依赖项需要6.0.

Looking at the source code of ASM's ClassVisitor I see that IllegalArgumentException is thrown in the constructor when an unhandled api version is passed. perf-plugin requires version 7.0 of ASM. However when checking the project dependencies with ./gradlew :app:dependencies I find out that version 6.0 of ASM is used. Obviously some other dependency requires 6.0.

我试图用来显式覆盖ASM依赖项

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

./gradlew :app:dependencies的输出中,我现在看到使用7.0,但仍然收到此错误:(

and in the output of ./gradlew :app:dependencies I now see that 7.0 is used but I still receive this error :(

更新:将com.google.firebase:firebase-plugins1.2.0降级到1.1.5为我解决了这个问题.

Update: Downgrading com.google.firebase:firebase-plugins from 1.2.0 to 1.1.5 solves the problem for me.

更新2:firebase-plugins的2.0.0版本开始,其用法为

Update 2: As of version 2.0.0 of firebase-plugins its usage is deprecated. The recommended solution is now to use the Performance Monitoring plugin explicitly. After migrating to the new plugin the problem is now solved for me.

更新3:,我必须撤回之前的声明.使用Performance Monitor插件确实可以在我的本地计算机上修复该构建,但是在我的Jenkins构建服务器上不是.正如Antimonit所述,将上述configurations.all块移到buildscript块中也无法修复该构建,尽管我可以在./gradlew buildEnvironment的输出中看到ASM 7.0用于该构建.

Update 3: I must withdraw my previous statement. Using the Performance Monitor plugin did fix the build on my local machine but not on my Jenkins build server. Also moving the configurations.all block mentioned above into the buildscript block as commented by Antimonit did not fix the build, although I can see in the output of ./gradlew buildEnvironment that ASM 7.0 is used for the build.

这篇关于错误:任务':app:transformClassesWithFirebasePerformancePluginForRelease'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆