Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Henson with Kotlin #198

Open
beyerss opened this issue Feb 1, 2018 · 2 comments
Open

Henson with Kotlin #198

beyerss opened this issue Feb 1, 2018 · 2 comments

Comments

@beyerss
Copy link

beyerss commented Feb 1, 2018

Hi, I'm using Android Studio 3.0.1 with Kotlin and I want to integrate Dart + Henson. To do this I started by adding the following to my grade file:

implementation 'com.f2prateek.dart:dart :2.0.3'
kapt 'com.f2prateek.dart:dart-processor:2.0.3'
implementation 'com.f2prateek.dart:henson:2.0.3'
kapt 'com.f2prateek.dart:henson-processor:2.0.3'`

I then created a new activity named WebViewActivity:

class WebViewActivity : Activity() { @BindView(R.id.webView) lateinit var webView: WebView
@InjectExtra
lateinit var url: String

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_web_view)
    ButterKnife.bind(this)
    Dart.inject(this)

    webView.loadUrl(url)
}}</code>

Then I moved to my first activity and tried to call Henson.with(this). That did not work. Autocomplete would not suggest Henson and when I type it manually there is a compiler error.

I'm trying to figure out if I missed something or if there are compatibility issues with Kotlin.

@stephanenicolas
Copy link
Collaborator

We are not aware of any incompatibility with kotlin. And helas, we actually don't use it yet.
There are a few things you can do to understand more the issue,

  1. is it only an IDE issue but it's actually working on command line ?
  2. Also, are files generated properly ?
  3. what is the impact of lateinit when you declare your field ?

@StephenVinouze
Copy link
Contributor

@beyerss This library works well with Kotlin and as a section in the README that refers to it.

From what I see I'd say you didn't apply the kapt plugin in your build.gradle

apply plugin: 'kotlin-kapt'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants