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

Firebase Crashlytics Gradle Plugins become unresolved after migrating to versions.properties #405

Closed
1 task done
mochadwi opened this issue Aug 12, 2021 · 18 comments
Closed
1 task done

Comments

@mochadwi
Copy link

🐛 Describe the bug

Really not sure if this is firebase-crashlytics-gradle issue or refreshVersions, before adding the refreshVersions, we were able to use any gradle API from firebase-crashlytics-gradle.

⚠️ Current behavior

Screen Shot 2021-08-12 at 6 49 14 PM

Screen Shot 2021-08-12 at 6 49 27 PM

Screen Shot 2021-08-12 at 6 50 05 PM

Screen Shot 2021-08-12 at 6 51 02 PM

✅ Expected behavior

The refreshVersions able to coexist with firebase-crashlytics-gradle

💣 Steps to reproduce

Not sure what/which information to provide here, but here's my config:

// versions.properties
version.firebase-crashlytics-gradle=2.7.1
// app/build.gradle.kts
plugins {
    // ... omitted
    id("com.google.firebase.crashlytics")
}
// buildSrc/settings.gradle.kts
pluginManagement {
    plugins {
        id("de.fayard.refreshVersions") version "0.11.0"
    }
}

plugins {
    id("de.fayard.refreshVersions")
}
// settings.gradle.kts
plugins {
    id("de.fayard.refreshVersions") version "0.11.0"
}

📱 Tech info

@mochadwi mochadwi changed the title refreshVersions might causing Firebase Crashlytics Gradle Plugins fails refreshVersions might causing Firebase Crashlytics Gradle Plugins to fails Aug 12, 2021
@mochadwi mochadwi changed the title refreshVersions might causing Firebase Crashlytics Gradle Plugins to fails Firebase Crashlytics Gradle Plugins unresolved after migrating to versions.properties Aug 12, 2021
@mochadwi mochadwi changed the title Firebase Crashlytics Gradle Plugins unresolved after migrating to versions.properties Firebase Crashlytics Gradle Plugins become unresolved after migrating to versions.properties Aug 12, 2021
@LouisCAD
Copy link
Member

You need to use the no-BoM variant.

Unfortunately, the issue is that the Firebase BoM used to include the Gradle plugin, but no longer does.

We have a plan to improve our dependency notations so that the default is the working one.

@mochadwi
Copy link
Author

mochadwi commented Aug 13, 2021

You need to use the no-BoM variant.

Unfortunately, the issue is that the Firebase BoM used to include the Gradle plugin, but no longer does.

We have a plan to improve our dependency notations so that the default is the working one.

Ahhh, noted, yes, we're currently using BoM for Firebase, well noted then, will use the no-BoM a workaround for this, will gives you updates 🙏

@mochadwi
Copy link
Author

You need to use the no-BoM variant.
Unfortunately, the issue is that the Firebase BoM used to include the Gradle plugin, but no longer does.
We have a plan to improve our dependency notations so that the default is the working one.

Ahhh, noted, yes, we're currently using BoM for Firebase, well noted then, will use the no-BoM a workaround for this, will gives you updates 🙏

This is so unfortunate, after using the no-BoM variant, the firebase plugin still fails to resolve 🙏

Screen Shot 2021-08-13 at 4 17 42 PM (2)

@LouisCAD
Copy link
Member

You have a clash between your dependencies and the ones from refreshVersions.

The Firebase object from refreshVersions is used and uses camelCase, not snake_case.

@LouisCAD
Copy link
Member

@jmfayard Can we make buildSrcLibs avoid clashes like that one?

@mochadwi
Copy link
Author

You need to use the no-BoM variant.

Unfortunately, the issue is that the Firebase BoM used to include the Gradle plugin, but no longer does.

We have a plan to improve our dependency notations so that the default is the working one.

Does this issue already opened, or should I create a feature request for this one?

@mochadwi
Copy link
Author

You have a clash between your dependencies and the ones from refreshVersions.

The Firebase object from refreshVersions is used and uses camelCase, not snake_case.

We've removed clashed dependencies from our buildSrc, unfortunately the firebase crashlytics plugins still failed to resolved 😭

Screen Shot 2021-08-16 at 1 54 34 PM
Screen Shot 2021-08-16 at 1 55 14 PM
Screen Shot 2021-08-16 at 1 55 44 PM

@LouisCAD
Copy link
Member

Next version of refreshVersions will improve bundled Firebase dependency notations. Hopefully, it helps.

In the meantime, just stick to plain hardcoded dependency notations and use the version placeholder (the underscore _).

@mochadwi
Copy link
Author

Next version of refreshVersions will improve bundled Firebase dependency notations. Hopefully, it helps.

In the meantime, just stick to plain hardcoded dependency notations and use the version placeholder (the underscore _).

Removing our previous buildSrc/Dependencies.kt and use hardcoded notation & version placeholder, unfortunately failed to resolve as well :(

@LouisCAD
Copy link
Member

refreshVersions 0.20.0 is out with updated dependency notations. If it still doesn't work on your end, please link us a minimal reproducing project.

@mochadwi
Copy link
Author

android-agentapp.zip here's our private internal project, we also remove everything from credentials and our entire codebase, except the build.gradle(.kts) and a few scripting files

@mochadwi
Copy link
Author

mochadwi commented Aug 24, 2021

android-agentapp.zip here's our private internal project, we also remove everything from credentials and our entire codebase, except the build.gradle(.kts) and a few scripting files

we also updated to the version 0.20.0, there's a little problems for this code (so we commented out for a while):

// implementation(Square.Retrofit2.retrofit) {
    //     exclude(group = "com.squareup.okhttp3")
    //     because("version 3.x pulled from retrofit")
    // }

please let us know if need anything 🙏 thank you ❤️

@LouisCAD
Copy link
Member

The issue is that firebaseCrashlytics { … } doesn't exist, because it's not optimized for Kotlin DSL, and I think you migrated from Groovy DSL which can go through runtime hacks to get that working. It's unrelated to refreshVersions itself.

@mochadwi
Copy link
Author

The issue is that firebaseCrashlytics { … } doesn't exist, because it's not optimized for Kotlin DSL, and I think you migrated from Groovy DSL which can go through runtime hacks to get that working. It's unrelated to refreshVersions itself.

looks like this is issue on firebase gradle plugins unsupported to GKD (Gradle Kotlin DSL) itself, cmiiw?

@LouisCAD
Copy link
Member

BTW, posting big screenshots isn't very helpful to us. Giving the relevant part of the error messages, and any relevant small snippet is much less overwhelming for us, and we can sometimes reply when on mobile, which is hardly doable with these gigantic screenshots.

@mochadwi
Copy link
Author

BTW, posting big screenshots isn't very helpful to us. Giving the relevant part of the error messages, and any relevant small snippet is much less overwhelming for us, and we can sometimes reply when on mobile, which is hardly doable with these gigantic screenshots.

well noted, my apologize for the screenshot, I should've resize it before commenting 🙏 :D

because it's not optimized for Kotlin DSL, and I think you migrated from Groovy DSL which can go through runtime hacks to get that working

Thanks again for confirming this 🙏

@LouisCAD
Copy link
Member

It supports it, but you cannot configure it the way you're doing. Just search for "firebase crashlytics kotlin dsl" on Google and you'll get the info you need to do what you want.

@mochadwi
Copy link
Author

mochadwi commented Aug 24, 2021

It supports it, but you cannot configure it the way you're doing. Just search for "firebase crashlytics kotlin dsl" on Google and you'll get the info you need to do what you want.

found it! thanks again!

for future readers, see workaround using this:

// app/build.gradle.kts

plugins {
  //...
  id("com.google.firebase.crashlytics")
}

android {
  buildTypes {
    getByName("release") {
      (this as ExtensionAware).configure<CrashlyticsExtension> {
        mappingFileUploadEnabled = true
        nativeSymbolUploadEnabled = true
        // etc.
       }
    }
  }
}

or

// app/build.gradle.kts
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension

android {
  buildTypes{
        getByName("release") {
            configure<CrashlyticsExtension> {
                mappingFileUploadEnabled = false          // to disable mapping file uploads (default=true if minifying)
                nativeSymbolUploadEnabled = true         // to enable NDK symbol file uploading (default=false)
                unstrippedNativeLibsDir = "path/to/libs" // optional override to change the default unstripped native library path, only used in NDK builds 
            }
        }
    }
}

ref:

  1. Firebase-crashlytics Gradle plugin: kotlin dsl support firebase/firebase-android-sdk#1622 (comment)
  2. Unresolved reference to firebaseCrashlytics Gradle extension since 2.6.0 [firebase-crashlytics-gradle] firebase/firebase-android-sdk#2665 (comment)

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

2 participants