草庐IT

jackson-module-kotlin

全部标签

java - 无法使用 Kotlin 在项目中设置 Realm

我正在尝试使用Realm在Kotlin中构建一个测试项目。这是我的模型:openclassBook:RealmObject(){//Standardgetters&settersgeneratedbyyourIDE…@PrimaryKeyopenvarid:Long=0openvartitle=""openvardescription=""openvarauthor=""openvarimageUrl=""}这是我得到的异常:FATALEXCEPTION:mainProcess:app.androidhive.info.realm,PID:18782java.lang.RuntimeE

android - 在Kotlin项目中应用Realm插件导致编译报错

我正在尝试将Realm添加到Android项目中,我已经添加了项目级别的classpath依赖项,但是将应用插件:'realm-android'我模块的build.gradle文件中的行导致以下构建错误:错误:任务':data:compileDebugAndroidTestJavaWithJavac'执行失败。java.lang.NoClassDefFoundError:org/jetbrains/kotlin/annotation/AnnotationProcessorWrapper没有那一行,应用程序构建并运行良好,其中还没有Realm代码。项目级build.gradle:allp

FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:

目录Centos7安装MySQL报如下错误:原因一:MySQL没有清理干净: 1、可以使用: rpm-qa|grep-imysql 查找是否装有MySQL2、可以使用: find/-namemysql 查找MySQL安装目录及相关文件并删除 原因二:缺少依赖包autoconf1、通过yum-yinstallautoconf命令安装 autoconf2、如果没有网络,可以前往如下官网下载依赖进行安装Centos7安装MySQL报如下错误:        FATALERROR:pleaseinstallthefollowingPerlmodulesbeforeexecuting/usr/bin/m

java - Kotlin 房间 :Entities and Pojos must have a usable public constructor

当我运行我的应用程序时,出现跟随错误。Error:EntitiesandPojosmusthaveausablepublicconstructor.Youcanhaveanemptyconstructororaconstructorwhoseparametersmatchthefields(bynameandtype).Triedthefollowingconstructorsbuttheyfailedtomatch:ChatMsg(java.lang.String,int):[arg0:null,arg1:null]Error:EntitiesandPojosmusthaveausa

android - 如何在 kotlin android 中使用 responseInputStream.read 编写 while 循环 - - while ((i = responseInputStream.read(byteContainer))

这个问题在这里已经有了答案:Bestwaytotranslatethisjavacodeintokotlin(3个答案)关闭5年前。如何在kotlinandroid中使用while循环和responseInputStream.read这里添加了responseInputStreamreadwhileloop.ktvalresponseInputStream=conn.inputStreamvalresponseStringBuffer=StringBuffer()valbyteContainer=ByteArray(1024)vari:Intwhile((i=responseInput

android - Lint 在读取 Kotlin 对象的 Java 类上崩溃

我有一个Kotlin数据类:dataclassInterviewCreation(valcandidateId:String,valofferId:String,valstartingDateTime:Long,valduration:Long,vallocation:String,valdescription:String?)和一个像这样开始的Mapper类(在Java中):publicInterviewCreationViewModeltoViewModel(InterviewCreationnewInterview,StringcandidateName,Stringcandid

android - 如何在 Kotlin 中使用 AndroidAnnotation @SharedPref

我尝试在kotlin中使用AndroidAnnotations@SharefPref,但出现以下错误org.androidannotations.annotations.sharedpreferences.Prefcanonlybeusedonanelementthatextendsorg.androidannotations.api.sharedpreferences.SharedPreferencesHelper我做错了什么?//Interface@SharedPref(SharedPref.Scope.APPLICATION_DEFAULT)openinterfaceMyPref

android - Dagger 2 : Module must be set

我是Dagger2的新手。我已经尝试过设置它。这是我的ActivityModule:@ModulepublicabstractclassActivityModule{@ContributesAndroidInjectorabstractProductListActivitycontributeProductListActivity();@ContributesAndroidInjectorabstractProductDetailsActivitycontributeProductDetailsActivity();}我的AppModule:@ModuleclassAppModule{

android - Kotlin 类型不匹配编译错误 : Require Success<T>, Found MyError

我遇到以下代码无法在kotlin中编译的问题。//StateModel.ktsealedclassStateModelclassLoading:StateModel()dataclassSuccess(valdata:T):StateModel()dataclassMyError(valmessage:String):StateModel()//StateModelTransformer.ktclassStateModelTransformer:FlowableTransformer{overridefunapply(upstream:Flowable):Publisher{retur

Android 将 kotlin 源代码部署到 maven 存储库

确保kotlin源包含在源分类器jar中以部署在maven存储库中的gradle配置是什么? 最佳答案 假设您正在使用自定义maven部署gradle配置,假设ChrisBanes提供的配置https://github.com/chrisbanes/gradle-mvn-push您唯一需要做的就是指定您正在使用*.kt文件(假设您在java文件夹中混合使用java和kotlin文件)android{sourceSets{main{java{include'**/*.java'include'**/*.kt'}}}}编辑:Ofc这只会