RoboGuice 2.0 + Android + Kotlin failure


#1

I receive this error when trying to run a one activity app

``

package com.silverkeytech.android_rivers

import android.app.Activity
import android.os.Bundle
import android.widget.TextView
import roboguice.inject.InjectView
import roboguice.activity.RoboActivity

public open class MainActivity(): RoboActivity() {
  [InjectView(R.id.main_message_tv)] var message : TextView? = null

  public override fun onCreate(savedInstanceState: Bundle?): Unit {
  super.onCreate(savedInstanceState)
  setContentView(R.layout.main)
  //   message!!.setText(“Hello world again”)
  }
}

09-11 05:07:26.238: ERROR/dalvikvm(5600): Invalid descriptor for class_idx: 'I’
09-11 05:07:26.238: ERROR/dalvikvm(5600): Trouble with item 0 @ offset 0xfc2c
09-11 05:07:26.238: ERROR/dalvikvm(5600): Cross-item verify of section type 0004 failed
09-11 05:07:26.238: ERROR/dalvikvm(5600): ERROR: Byte swap + verify failed
09-11 05:07:26.238: ERROR/dalvikvm(5600): Optimization failed
09-11 05:07:26.238: ERROR/installd(801): dexopt failed on ‘/data/dalvik-cache/data@app@com.silverkeytech.android_rivers-2.apk@classes.dex’ res = 65280

LEDE 122.746 and Kotlin   0.4.145 .

The libraries involved are guice-3.0-no_aop.jar, jsr305-1.3.9.jar and roboguice-2.0.jar


#2

I can confirm that currently a problem exists in mixing Roboguice and Kotlin but we will need more time for investigation. Could you report an issue to our tracker? It will be helpfull if you assign archive with you project, because in my case there was an error on application installation step.


#3

http://youtrack.jetbrains.com/issue/KT-3055 (the sample project is being uploaded as of this time)