refreshVersions: Firebase Crashlytics Gradle Plugins become unresolved after migrating to `versions.properties`

🐛 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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

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.

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.

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. https://github.com/firebase/firebase-android-sdk/issues/1622#issuecomment-639584044
  2. https://github.com/firebase/firebase-android-sdk/issues/2665#issuecomment-849897741

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

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