Ошибка выполнения для задачи ': app: kaptDemoProductionDebugKotlin'.? - PullRequest
0 голосов
/ 17 декабря 2018

Я получаю следующее исключение ниже:

C:\Users\admin\Desktop\masters\app\build\tmp\kapt3\stubs\demoProductionDebug\com\empowered\healo\ui\adapters\HistoryQuestionAdapter.java:155:
error: incompatible types: possible lossy conversion from long to int @android.support.annotation.IntDef(value = {1L, 0L})

Ниже мой Logcat:

3:55:52 PM: Executing task 'assembleDebug'...

Executing tasks: [assembleDebug]

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to C:\Users\admin\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to C:\Users\admin\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
:app:checkDemoProductionDebugClasspath UP-TO-DATE
:app:preBuild UP-TO-DATE
:errorcheckmodule:preBuild UP-TO-DATE
:errorcheckmodule:preDebugBuild UP-TO-DATE
:errorcheckmodule:checkDebugManifest UP-TO-DATE
:errorcheckmodule:processDebugManifest UP-TO-DATE
:app:preDemoProductionDebugBuild UP-TO-DATE
:errorcheckmodule:compileDebugAidl NO-SOURCE
:app:compileDemoProductionDebugAidl NO-SOURCE
:errorcheckmodule:packageDebugRenderscript NO-SOURCE
:app:compileDemoProductionDebugRenderscript UP-TO-DATE
:app:checkDemoProductionDebugManifest UP-TO-DATE
:app:generateDemoProductionDebugBuildConfig UP-TO-DATE
:app:mainApkListPersistenceDemoProductionDebug UP-TO-DATE
:app:mergeDemoProductionDebugShaders UP-TO-DATE
:app:compileDemoProductionDebugShaders UP-TO-DATE
:app:generateDemoProductionDebugAssets UP-TO-DATE
:errorcheckmodule:mergeDebugShaders UP-TO-DATE
:errorcheckmodule:compileDebugShaders UP-TO-DATE
:errorcheckmodule:generateDebugAssets UP-TO-DATE
:errorcheckmodule:packageDebugAssets UP-TO-DATE
:app:mergeDemoProductionDebugAssets UP-TO-DATE
:app:processDemoProductionDebugGoogleServices
Parsing json file: C:\Users\admin\Desktop\masters\app\google-services.json
:app:createDemoProductionDebugCompatibleScreenManifests UP-TO-DATE
:app:processDemoProductionDebugManifest
:app:fabricGenerateResourcesDemoProductionDebug
:app:generateDemoProductionDebugResValues UP-TO-DATE
:app:generateDemoProductionDebugResources UP-TO-DATE
:errorcheckmodule:compileDebugRenderscript UP-TO-DATE
:errorcheckmodule:generateDebugResValues UP-TO-DATE
:errorcheckmodule:generateDebugResources UP-TO-DATE
:errorcheckmodule:packageDebugResources UP-TO-DATE
:app:mergeDemoProductionDebugResources
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2601: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2674: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.
C:\Users\admin\Desktop\masters\app\build\intermediates\incremental\mergeDemoProductionDebugResources\merged.dir\values\values.xml:2675: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.

:app:splitsDiscoveryTaskDemoProductionDebug UP-TO-DATE
:errorcheckmodule:generateDebugRFile UP-TO-DATE
:app:processDemoProductionDebugResources
error: string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.

:errorcheckmodule:generateDebugBuildConfig UP-TO-DATE
:errorcheckmodule:prepareLintJar UP-TO-DATE
:errorcheckmodule:generateDebugSources UP-TO-DATE
:errorcheckmodule:javaPreCompileDebug UP-TO-DATE
:errorcheckmodule:compileDebugJavaWithJavac UP-TO-DATE
:errorcheckmodule:processDebugJavaRes NO-SOURCE
:errorcheckmodule:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:kaptGenerateStubsDemoProductionDebugKotlin UP-TO-DATE
e: C:\Users\admin\Desktop\masters\app\build\tmp\kapt3\stubs\demoProductionDebug\com\empowered\healo\ui\adapters\HistoryQuestionAdapter.java:155: error: incompatible types: possible lossy conversion from long to int
    @android.support.annotation.IntDef(value = {1L, 0L})
                                                ^
e: C:\Users\admin\Desktop\masters\app\build\tmp\kapt3\stubs\demoProductionDebug\com\empowered\healo\ui\adapters\HistoryQuestionAdapter.java:155: error: incompatible types: possible lossy conversion from long to int
    @android.support.annotation.IntDef(value = {1L, 0L})
                                                    ^
:app:kaptDemoProductionDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptDemoProductionDebugKotlin'.
> Compilation error. See log for more 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 29s
33 actionable tasks: 6 executed, 27 up-to-date
3:56:22 PM: Task execution finished 'assembleDebug'.

1 Ответ

0 голосов
/ 17 декабря 2018

Сначала проверьте это для типов примитивов с потерями: https://stackoverflow.com/a/51632153/3460038

Затем проверьте наличие проблем с NDK: https://stackoverflow.com/a/42324530/3460038

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