Отчет о покрытии тестов Android не проходит с предупреждениями Proguard - PullRequest
0 голосов
/ 15 октября 2018

Я пытаюсь выполнить отчет о покрытии тестов Android в проекте Android Studio.И он выдает следующую ошибку, однако модуль приложения работает и успешно собирается.

Note: there were 13 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 81 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 133 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 17 instances of library classes depending on program classes.
         You must avoid such dependencies, since the program classes will
         be processed, while the library classes will remain unchanged.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
Warning: there were 1 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
Thread(Tasks limiter_2): destruction
> Task :mobile:transformClassesAndResourcesWithProguardForAlphaEssayerAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mobile:transformClassesAndResourcesWithProguardForAlphaEssayerAndroidTest'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 55s

Я добавил эти строки в файл build.gradle для настройки отчета о покрытии:

apply plugin: 'jacoco'

testCoverageEnabled = true в секции buildTypes

И

android.testOptions {
    unitTests.all {
        jacoco {
            includeNoLocationClasses = true
        }
    }
}

Я новичок в Gradle.Но как Proguard связан с отчетом о покрытии кода, разве он не должен быть включен только для релизных сборок?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...