我想使用kotlin @Parcelize的功能,
我在apply the plugin: 'kotlin-android-extensions'
上摇了摇,并添加了
androidExtensions {
experimental = true
}
但错误继续出现。此错误消息:
Error:(28, 0) Could not find method androidExtensions() for arguments [build_8di01fmxa4d18k9q0yy3fdd20$_run_closure2@27f46852] on project ':app' of type org.gradle.api.Project.
<a href="openFile:F:\BELAJAR\ANDROID\AndroidStudioProjects\KADE\app\build.gradle">Open File</a>
答案 0 :(得分:4)
应用插件:'com.android.application'
应用插件:“ kotlin-android”
应用插件:“ kotlin-android-extensions”
android {
Igo.EndpointTpl = new Ext.XTemplate(['<tr>', ' <th class="header-140">Media Handler</th>', ' <td>{endpointInstance.mhaddress}{[this.renderPopName(values.endpointInstance.mhaddress)]},{[this.renderPartition(partitionValue)]}</td>', '</tr>',{ renderPopName : function(address) { if (address) { var popId = address.split(".", 2)[1]; return Ext.String.format('<span class="txt-color-red"> ({0})<span>', Igo.Pop.getFriendlyName(popId)); } else { return ''; } }, renderPartition: function(records){ let get_internalId = records[0].internalId; let ele_meetingID = records[0].data.meetingID; let ele_Partition = records[0].data.partition; if(ele_Partition && ele_meetingID === get_internalId){ return Ext.String.format('<span class="txt-color-red"> ,({0})<span>', ele_Partition); }else{ return ""; } }} ]);
}
依赖项{ ..... }
答案 1 :(得分:0)
要使用Kotlin parcelize
,您必须执行以下步骤:
1-将此行添加到您的Gradle中:
apply plugin: 'org.jetbrains.kotlin.android.extensions'
2-也可以在Gradle中启用android扩展:
androidExtensions {
experimental = true
}
就是这样。但请注意,您已添加
如果您以前没有,也apply plugin: 'kotlin-android-extensions'
也可以。
答案 2 :(得分:0)
只需将此行添加到构建文件中 classpath“ org.jetbrains.kotlin:kotlin-gradle-plugin:$ kotlin_version”