Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class versions V1_5 or less must use F_NEW frames #26

Closed
yinyangwu opened this issue Oct 9, 2020 · 15 comments
Closed

Class versions V1_5 or less must use F_NEW frames #26

yinyangwu opened this issue Oct 9, 2020 · 15 comments

Comments

@yinyangwu
Copy link

+-----------------------------------------------------------------------------+
|                     Multi Languages Plugin START                            |
+-----------------------------------------------------------------------------+
+------------------------isIncremental:false----------------------------------+
add attach method to com/tianxin/downloadcenter/backgroundprocess/RemoteBackgroundProcess
add attach method to com/tianxin/downloadcenter/backgroundprocess/processprotecter/ForegroundAssistService
add attach method to com/tcloud/core/connect/mars/service/MarsServiceNative
add attach method to com/tcloud/core/ui/baseview/SupportActivity
add applyOverrideConfiguration method to com/tcloud/core/ui/baseview/SupportActivity

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultiLanguagesForGoogleDebug'.
> Class versions V1_5 or less must use F_NEW frames.

* 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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 1s
657 actionable tasks: 444 executed, 213 from cache

我使用的gradle版本如下:

classpath 'com.android.tools.build:gradle:4.0.2'

我使用的multi-languages版本如下:

classpath 'com.github.jokar:multi-languages.plugin:0.1.1'
@yinyangwu
Copy link
Author

我发现是更改了Firebase Performance框架的版本就会引起上面的问题,现在我使用的是版本如下,是没有问题的

classpath 'com.google.firebase:perf-plugin:1.3.1'

但是,如果我把Firebase Performance框架的版本更改为下面的

classpath 'com.google.firebase:perf-plugin:1.3.2'

就会出现上面的问题了,在构建apk的时候failed。
我建议你能不能把plugin里面build相关的classpath、asm、gradle都升级到最新版本呀,可以吗?谢谢了

@MichaelJokAr
Copy link
Owner

好的,

@MichaelJokAr
Copy link
Owner

MichaelJokAr commented Oct 18, 2020

麻烦使用0.1.2版本试试,代码分支2.0.1

@Yumore
Copy link
Contributor

Yumore commented Oct 19, 2020

麻烦使用0.1.2版本试试,代码分支2.0.1

使用Android Studio4.1就会出现

plugin的api依赖gradle版本太低导致的

建议升级gradle版本

@MichaelJokAr
Copy link
Owner

@Yumore 本地测试没有出现这样问题,你这个应该是你本地环境变量里配置的gralde版本过低了

@yinyangwu
Copy link
Author

@MichaelJokAr 我这里试过了0.1.2仍然还是有问题的,我写了个Demo,你可以跑起来试下打包的时候就是在plugin往各个Activity插桩的时候就还是报这个错,https://github.com/yinyangwu/FirebasePerformanceDemo.git

@yinyangwu
Copy link
Author

yinyangwu commented Oct 20, 2020

FirebasePerformanceDemo里面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:4.1.0"
        classpath 'com.google.firebase:perf-plugin:1.3.2'
        classpath 'com.github.jokar:multi-languages.plugin:0.1.2'
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

app层级build.gradle,

plugins {
    id 'com.android.application'
    id 'com.google.firebase.firebase-perf'
    id 'multi-languages'
}

android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.youngwu.firebase.performance"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
    }

    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.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
    implementation 'com.google.firebase:firebase-perf:19.0.9'
    implementation 'com.github.jokar:multi-languages:0.1.2'
}

以上是我的配置方案,执行打包命令:

gradle clean assembledebug

报错信息:

yinyangwudeMacBook-Pro:FirebasePerformanceDemo yinyangwu$ gradle clean assembledebug

> Task :app:transformClassesWithMultiLanguagesForDebug
+-----------------------------------------------------------------------------+
|                     Multi Languages Plugin START                            |
+-----------------------------------------------------------------------------+
+------------------------isIncremental:false----------------------------------+
add attach method to com/google/android/gms/common/api/GoogleApiActivity
add attach method to com/google/firebase/components/ComponentDiscoveryService
add attach method to androidx/core/app/NotificationCompatSideChannelService
add attach method to androidx/core/app/JobIntentService
add attach method to androidx/core/app/ComponentActivity
add attach method to com/youngwu/firebase/performance/MainActivity
add applyOverrideConfiguration method to com/youngwu/firebase/performance/MainActivity

> Task :app:transformClassesWithMultiLanguagesForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultiLanguagesForDebug'.
> Class versions V1_5 or less must use F_NEW frames.

* 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

BUILD FAILED in 13s
23 actionable tasks: 22 executed, 1 up-to-date

gradle本地环境变量版本:

yinyangwudeMacBook-Pro:~ yinyangwu$ gradle --version

Welcome to Gradle 6.5!

Here are the highlights of this release:
 - Experimental file-system watching
 - Improved version ordering
 - New samples

For more details see https://docs.gradle.org/6.5/release-notes.html


------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_221 (Oracle Corporation 25.221-b11)
OS:           Mac OS X 10.15.7 x86_64

@Yumore
Copy link
Contributor

Yumore commented Oct 20, 2020

@Yumore 本地测试没有出现这样问题,你这个应该是你本地环境变量里配置的gralde版本过低了

我使用的是Android Studio4.1 gradle 版本6.7-all

目前使用 classpath 'com.github.jokar:multi-languages.plugin:0.1.1'
升级到0.1.2就直接报错

我直接将源代码clone到本地配置完成之后也是有问题
然后将plugin的gradle版本升级就好了使用重新构建的本地插件就没问题

plugin/build.gradle配置如下:
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'maven'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation gradleApi()
implementation localGroovy()
implementation 'com.android.tools.build:gradle:4.1.0'
implementation 'com.android.tools.build:gradle-api:4.1.0'
api 'org.ow2.asm:asm:8.0.1'
api 'org.ow2.asm:asm-analysis:8.0.1'
api 'org.ow2.asm:asm-commons:8.0.1'
api 'org.ow2.asm:asm-tree:8.0.1'
api 'org.ow2.asm:asm-util:8.0.1'
}

repositories {
jcenter()
google()
mavenCentral()
}
group = 'com.github.jokar'
version = '2.0.0'

uploadArchives {
repositories {
mavenDeployer {
repository(url: uri('../repos'))
}
}
}

publish {
userOrg = 'a10188755550'
groupId = 'com.github.jokar'
artifactId = 'multi-languages.plugin'
publishVersion = "$version"
desc = 'android multi language support (support android O+)'
website = 'https://github.com/MichaelJokAr/MultiLanguages'
}

@jxpanda
Copy link

jxpanda commented Oct 22, 2020

我第一次用, 也碰到这个问题了, 不知道怎么搞。

@MichaelJokAr
Copy link
Owner

@Yumore 0.1.4解决了这个问题, @yinyangwu 但是没有解决和firebase一起集成时报的错,已经升级了ASM版本了

@yinyangwu
Copy link
Author

@Yumore 0.1.4解决了这个问题, @yinyangwu 但是没有解决和firebase一起集成时报的错,已经升级了ASM版本了

好吧,我再试下新版本0.1.4看看

@yinyangwu
Copy link
Author

经验证,0.1.4的版本还是没法处理这个Demo(https://github.com/yinyangwu/FirebasePerformanceDemo.git)中出现的问题:

Class versions V1_5 or less must use F_NEW frames.

@yinyangwu
Copy link
Author

关于这个问题,我还特地去问了下Firebase官方,他们测试后发现还是问题出在你写的这个plugin里面。

这里是他们的回复:

I tested this with the earlier Firebase Performance versions listed in the original description, and with the Firebase Performance dependencies entirely removed. In both cases the same error occurs.

I then tested the Multi Language dependencies in a clean Android Studio project (chose the "Basic Activity" option with the default minimum SDK of Android Oreo).

When the following dependencies are added for Multi Language to the clean project, the same error occurs:

classpath 'com.github.jokar:multi-languages.plugin:0.1.2'
id 'multi-languages'
implementation 'com.github.jokar:multi-languages:0.1.2'
Therefore, this does not appear to be a Firebase SDK issue. Please open an issue in https://github.com/MichaelJokAr/MultiLanguages/issues instead.

Thank you again for reaching out to the Firebase team!

firebase/firebase-android-sdk#2183

麻烦大佬有时间的话,再深入研究一下哈,有劳了

@MichaelJokAr
Copy link
Owner

@yinyangwu 已修复v0.1.5, 抱歉最近有点忙修复晚了

@yinyangwu
Copy link
Author

大佬辛苦了,我试了下,现在真的可以了呃,太感谢了。

@yinyangwu 已修复v0.1.5, 抱歉最近有点忙修复晚了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants