Firebase performance monitor causing "D8: Unsupported source file type"
Asked Answered
E

5

16

I added

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

and when I ran build script I got

/transforms/FirebasePerformancePlugin/dev/debug/174/module-info.class: D8: Unsupported source file type

What kind of problem it could be?

I updated all plugins, play services, and Android Studio, but with no luck

Everyplace answered 6/6, 2019 at 15:53 Comment(3)
Did you find a solution?Wessling
no, no options for now. it works for dev build, but not for releaseEveryplace
exactly, same issue I am facingWessling
E
2

This issue was fixed somewhere between Android Studio 3.5 Beta 2 and Android Studio 3.6 Canary 5, there were a bunch of similar issues with module-info.class.

In my case to fix issue I had not only update Android Studio, but also update gradle plugin.

Steps is:

  1. Install new version alongside your stable version (You also can configure current version to use updates from canary chanel)

    More info here

    Download link (I downloaded 3.6 Canary 5)

  2. After you installed new Android Studio update grade plugin:

    in gradle/wrapper/gradle-wrapper.properties chande distributionUrl to

    distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

  3. Don't forget Build->Clean Project

Eclair answered 17/7, 2019 at 23:58 Comment(5)
yep. it works. anyway I'd recommend to wait for AS 3.6 in stable channel. thanks for helpEveryplace
I don't understand the relation of this issue to AS. If I need to generate an apk, I could do it through gradle so how does AS solve this issue? :(Cyclometer
Sadly I don't know what is under the hood of AS, but I saw related issues in AS bug tracker, that's how I got to this solution. Now I have 2 AS installed, one for everyday development and other for releasing builds.Eclair
For me, updating Android Studio from 3.5 to 3.5.1 was enough to fix the build in Android Studio. As for command line build, it's still broken; updating Gradle to 5.5 had no effect.Lauren
Jonik, note that updating Gradle wouldn't fix it, only upgrading the Gradle Android plugin (as mentioned in other answers, and in this one, but less specifically).Cinchonine
D
5

I Solve This issue by updating gradle version

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

Denton answered 7/1, 2020 at 6:53 Comment(1)
Worked for me! Would be nice to include what file this update happens in in the answer.Cinchonine
L
4

Update: Android Gradle Plugin 3.5.0 fixes this. See this issue and this one issue, both fixed.

(Unfortunately, in my project, this other issue still remains even in 3.5.3.)


I started getting the same error after updating a (company internal) library dependency, but then I kept getting it even after reverting that update. Very strange!

> Task :app:transformClassesAndResourcesWithR8ForBetaRelease FAILED
R8 is the new Android code shrinker. If you experience any issues, please file a bug at
https://issuetracker.google.com, using 'Shrinker (R8)' as component name. You can
disable R8 by updating gradle.properties with 'android.enableR8=false'.

.../transforms/FirebasePerformancePlugin/beta/release/66/module-info.class:
D8: Unsupported source file type 

The only thing I found that helped was to do what the Gradle build output says and temporarily switch back to ProGuard, with:

android.enableR8=false

in gradle.properties.

Lauren answered 8/10, 2019 at 12:32 Comment(0)
E
2

This issue was fixed somewhere between Android Studio 3.5 Beta 2 and Android Studio 3.6 Canary 5, there were a bunch of similar issues with module-info.class.

In my case to fix issue I had not only update Android Studio, but also update gradle plugin.

Steps is:

  1. Install new version alongside your stable version (You also can configure current version to use updates from canary chanel)

    More info here

    Download link (I downloaded 3.6 Canary 5)

  2. After you installed new Android Studio update grade plugin:

    in gradle/wrapper/gradle-wrapper.properties chande distributionUrl to

    distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

  3. Don't forget Build->Clean Project

Eclair answered 17/7, 2019 at 23:58 Comment(5)
yep. it works. anyway I'd recommend to wait for AS 3.6 in stable channel. thanks for helpEveryplace
I don't understand the relation of this issue to AS. If I need to generate an apk, I could do it through gradle so how does AS solve this issue? :(Cyclometer
Sadly I don't know what is under the hood of AS, but I saw related issues in AS bug tracker, that's how I got to this solution. Now I have 2 AS installed, one for everyday development and other for releasing builds.Eclair
For me, updating Android Studio from 3.5 to 3.5.1 was enough to fix the build in Android Studio. As for command line build, it's still broken; updating Gradle to 5.5 had no effect.Lauren
Jonik, note that updating Gradle wouldn't fix it, only upgrading the Gradle Android plugin (as mentioned in other answers, and in this one, but less specifically).Cinchonine
F
2

Turn off Firebase-performance plugin.
Android Studio 3.6 Canary 1 has this issue too.
I didn't find another way to release build my project.

Footboy answered 11/11, 2019 at 15:0 Comment(0)
G
0

i solve this problem with 3 steps:

1.update the "distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip"

2.update the "classpath "com.android.tools.build:gradle:3.6.3"

3.update the Studio 3.6.3

in other way(i don't like it)

//apply plugin: 'com.google.firebase.firebase-perf'

... //classpath "com.google.firebase:perf-plugin:1.3.1"

Gothar answered 25/5, 2020 at 1:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.