Dexguard mapping files not being uploaded for Android Plugin for Gradle 3.0+ - crashlytics

We are using Dexguard and the latest Fabric Gradle Plugin version 1.25.2. However, when we run the build with Android Plugin for Gradle 2.3.3, we see the gradle task run for '{namespace}:crashlyticsUploadDeobs{flavor + buildvariant}, but with Android PLugin for Gradle 3.0.1, we don't see this gradle task run and the logs in Crashlytics are not de-obfuscated.
My assumption is that this is the task that uploads the Dexguard mapping files up to Crashlytics.
I see the Fabric Gradle Plugin version 1.24.0 changelog indicates that it addressed this very issue for Proguard. Could there be another issue for Dexguard that needs to be addressed in the Fabric Gradle Plugin?

With help from GuardSquare I was able to identify the issue. Dexguard 8.1 provides a 'dexguard-partial' plugin that let's you exclude dexguard for certain buildTypes. By excluding dexguard on debug builds, you get faster build times. However, this 'dexguard-partial' plugin does not appear to be recognized by Fabric's plugin for Gradle. Therefore, those tasks for uploading the Dexguard mapping files to Crashlytics, never run.
I was able to resolve this issue by switching from the 'dexguard-partial', back over to the 'dexguard' plugin and adding the following conditional check to ensure the plugin is only included for Release builds:
getGradle().getStartParameter().getTaskRequests().toString().contains("Release")
This keeps our build times down for debug builds, by excluding dexguard for those builds. And resolves the Crashlytics issue by including dexguard for release builds.

Related

aws codebuild runtime verison not supporting latest gradle version 7

I am trying to build my java springboot cod using gradle 7 but getting this error while requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 5.6. How can i get the latest version of gradle
Hard to tell without much details on the build failure. I had issues myself trying to build in CodeBuild with gradle 7 and I solved by:
Make sure the source code pulled by CodeBuild contains the gradle/wrapper folder and all its contents (including the jar file).
Check in the gradle-wrapper.properties have the distributionUrl to the gradle distribution for your project.
Use ./gradlew build as a command in CodeBuild.

option to create a kotlin multiplatform project not present in idea 2019.3

i want to create a kotlin mp project in intellij idea 2019.3 Community, but the options i see in new project window for kotlin are just jvm|idea and js|idea.
In several articles there are options like mobile shared library | gradle, present even for older versions oj IJIdea.
I already have kotlin in another project, as part of a maven project
any hints?
Make sure you have latest Kotlin plugin installed and Gradle bundled plugin enabled.
See these steps about creating Kotlin MPP project.
gradle plugin was enabled, but still something smelled, so after some time spent enabling/disabling plugins, i decided to enable android support plugin - then after restart idea complained that gradle-java plugin is not enabled, after enabling that (from the error tab link, not the plugin management window in preferences) - the options to create various gradle projects appeared, including the ones for kotlin/multiplatform

Robolectric 4 AndroidX NoClassDefFoundError MonitoringInstrumentation with IntelliJ 2018.3.4

Problem
after switching to androidX
with a multi-module Android library
using IntelliJ 2018.3.4 #IC-183.5429.30
using Robolectric 4.1 with android gradle plugin 3.3.1
when executing Robolectric tests, I receive:
java.lang.NoClassDefFoundError: androidx/test/runner/MonitoringInstrumentation
No duplicate question:
I read the other topics which pop up when using google or stackoverflow search but they are about a more specific error which is worked-around via adding specific dependencies. In my case I was not able to determine which dependency to add.
I add dependencies to androidx.test:core
for the build type under test.
In my case it was debug so in the build.gradle I add
debugImplementation 'androidx.test:core:1.2.0'
I read that no workaround should be required with Android Studio 3.3 and Robolectric 4.0.
Use Android Studio 3.3.1+ with Robolectric 4.0+
This works for me.

Intellij IDEA With Multiple Gradle Projects

I am working on two Gradle projects. One of these projects is a supporting library that will be used by other projects in the future so project A depends on project B but not as a 'multi module project'. The dependency is to be resolved through the artifact repo so project a declares it as a compile dependency using it's maven coordinates.
My problem is when working on these two projects in IntelliJ changes to project B aren't made available to project A until I install it (using the Gradle Maven plugin) in my local repo. This is kind of annoying and slows down my workflow. Is there a way to get IntelliJ to automatically update the dependency internally?
This is supported in the latest versions of Gradle and IntelliJ. It is known as a Composite Build.
Composite builds can be declared in the project's settings.gradle file as follows:
includeBuild '../my-app'
or by using the --include-build command line argument:
$ gradle --include-build ../my-utils run
Take a look at the Composite Builds with Gradle and IntelliJ IDEA Webinar for instructions on how to configure the integration.
In IDEA 2017 you can right-click on the gradle module and use Composite Build Configuration to link the current module to one or more gradle module already opened in the current workspace.

Intellij Idea 12 gradle build

I am trying to build a project with gradle from within Intellij Idea 12 (commercial editon) but this keeps failing. I have the gradle plugin enabled and also the gradle gui plugin. The native project gradle import is working. (I'm not using gradle idea btw.)
When using the bash I only run gradle war to build my web application. Now I want to do the same from within Intellij.
The gradle gui plugin seems to be using the wrong JDK (I guess it's the one Idea uses, a 1.6 JDK) and therefor fails to compile because this is a JDK 1.7 project. And it doesn't integrate well into Idea because it seems like an external build process (like triggering external ant tasks).
What I have done so far is to configure my own artifact in a way that is equivalent to the one gradle war would have build. But that means a lot of configuration and simply feels wrong. There should be a better way?
So what do I have to do to make Idea compile a project in a way similar to the command line gradle task?
JetGradle plugin doesn't provide native tasks support at the moment. It's scheduled for v.12.1 - IDEA-95897. Feel free to track the plugin's news and update it manually as soon as corresponding support is provided.