Skip to content

Add example with kotlin #60

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

Closed
diego-lipinski-de-castro opened this issue Aug 18, 2021 · 3 comments
Closed

Add example with kotlin #60

diego-lipinski-de-castro opened this issue Aug 18, 2021 · 3 comments

Comments

@diego-lipinski-de-castro

Please add example of integrating in Android with kotlin

@akshaybhange
Copy link

akshaybhange commented Aug 23, 2021

Yes please. My App is not building after updating my MainActivity.kt

class MainActivity : FlutterApplication() {
    fun onCreate() {
        ActivityLifecycleCallback.register(this) //<--- Add this before super.onCreate()
        super.onCreate()
    }
}

Logcat

Running Gradle task 'assembleDebug'...
setu/MainActivity.kt: (6, 23): Unresolved reference: FlutterApplication
setu/MainActivity.kt: (8, 9): Unresolved reference: ActivityLifecycleCallback
setu/MainActivity.kt: (9, 15): Unresolved reference: onCreate

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

@dj-wedig
Copy link

dj-wedig commented Aug 31, 2021

ActivityLifecycleCallback.register(this.application);

Use this line for Kotlin.

And don't forget to include "com.clevertap.android.sdk.ActivityLifecycleCallback" as import.

@darshanclevertap
Copy link
Contributor

@diego-lipinski-de-castro We will consider migrating the sample app from Java to Kotlin. Meanwhile, if you're facing any issues, please open this thread again to give us details.

@akshaybhange the solution provided by @dj-wedig will work.

Closing this thread as of now.

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

4 participants