Question

I use custom build directory for gradle. It is set in the following way:

gradlew_runner.bat --gradle-user-home="$(GradleUserHome)" -PbuildDir="$(BuildDir)"

(these parameters are passed to gradlew.bat)

Crashlytics plugin throws an com.crashlytics.tools.android.project.ManifestData$ManifestIOException exception,

because it is trying to find manifest in my source directory myproject\build\manifests\debug\AndroidManifest.xml

but my manifest is located in $(BuildDir)\myproject\build\manifests\debug\AndroidManifest.xml.

Crashlytics shows following message:

usage: com.crashlytics.tools.android.DeveloperTools

-androidManifest Path to AndroidManifest.xml)

But these parameters can't be passed directly to gradlew.bat.

Is there any way to set path to manifest in build.gradle?

Était-ce utile?

La solution

Quoting Michael Bonnel of Crashlytics:

Just add this in your build.gradle flavor:

crashlytics { 
  manifestPath = 'path/to/manifest/AndroidManifest.xml'
}

This will override where we are looking!

And in my case, I'm passing build directory as command line argument -PbuildDir="somepath", so final solution is:

if (buildDir) {
    buildTypes {
        debug {
            crashlytics {
                manifestPath = "$buildDir/manifests/debug/AndroidManifest.xml"
            }
        }
    }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top