문제

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?

도움이 되었습니까?

해결책

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"
            }
        }
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top