3

Recently I have had to update my project to use Gradle 4.4 from 4.1. i.e.

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

in my gradle-wrapper.properties file.

However, this is incompabitble with the fabric plugin

apply plugin: 'io.fabric'

As since the gradle update, I now get build errors when syncing my project. Such as:

Error:Could not get unknown property 'manifestFile' for task ':Module:generateVariantFlavorRFile' of type com.android.build.gradle.internal.res.GenerateLibraryRFileTask.

Does anyone know when/if there will be a new plugin update that is compatible with gradle 4.4+?

FlashAsh80
  • 1,357
  • 1
  • 16
  • 27
  • I don't think is a problem of gradle. I've made many project with crashlytics with gradle 4. If you have followd this instruction: https://firebase.google.com/docs/crashlytics/get-started you, for sure, should be able to use crashlytics and gradle 4. It's a single project or is a project with some libraries always made by you? Are you using the stable gradle plugin? `{ classpath 'com.android.tools.build:gradle:3.0.1' }` – shadowsheep Feb 27 '18 at 11:27
  • @shadowsheep It's not a problem with gradle. It's a problem with the fabric plugin being incompatible with the latest version of gradle. The plugin works fine on 4.1 but not on 4.4 onwards. And I need to use gradle 4.4. My gradle build tools is already { classpath 'com.android.tools.build:gradle:3.0.1' } – FlashAsh80 Feb 27 '18 at 11:44
  • Updated to 4.4. Got no error: `distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip` – shadowsheep Feb 27 '18 at 11:56
  • I suggest you try with a new project. Simple Single Activity application and update your gradle plugin to 4.4 and then add crashlytics. Just to be sure you get no errors too. – shadowsheep Feb 27 '18 at 11:57
  • @shadowsheep Yeah, created a new project added the plugin with gradle 4.4 and the issue still occurs. It only happens if you have `apply plugin: 'io.fabric'` which I need as I have another module – FlashAsh80 Feb 27 '18 at 12:50
  • I assure you I have applied plugin ‘io.fabric’. Tested myself. It compiles great. Did you have apply plugin in your module level or io your project level buold.gradle? – shadowsheep Feb 27 '18 at 12:53
  • Which version of Android Studio do you have? – shadowsheep Feb 27 '18 at 12:57
  • @shadowsheep Thanks. I am on 3.0.1. I have feature modules... Which is what might be causing the issue. I have since added `crashlytics { instantAppSupport true }` to my base feature's build.gradle and it seems to have resolved this issue. I was not sure if it was needed before, as I don't have an InstantApp, just feature modules. Probably the name is misleading if what this does is enable feature module support. – FlashAsh80 Feb 27 '18 at 14:47
  • So, that's it. As for the feature module I don't know, but you can check SO if someone had the same problem with another description or post another question. C'ya! – shadowsheep Feb 27 '18 at 14:51

1 Answers1

2

So my project included feature modules, where in the the base module's build.gradle, I apply the fabric plugin. i.e. apply plugin: 'io.fabric'

It turns out that gradle version 4.4 + does work but you need to add the following:

crashlytics { instantAppSupport true }

in your base module's build.gradle. I didn't actually have an instant app, but even with feature modules in appears that this line is needed.

More info on how this can be added can be found here: How do I integrate Crashlytics with Android Instant Apps?

FlashAsh80
  • 1,357
  • 1
  • 16
  • 27
  • Also solved my problem for this error message from Crashlytics `Could not get unknown property 'manifestFile' for task ':core:generateDebugRFile' of type com.android.build.gradle.internal.res.GenerateLibraryRFileTask.` – SoftWyer Mar 09 '18 at 09:21