Home Receiver Type Mismatch with Anko Layouts
Reply: 0

Receiver Type Mismatch with Anko Layouts

user1715
1#
user1715 Published in July 17, 2018, 11:10 pm

I am trying to create layouts with Anko DSL in my support v4 Fragment but the IDE shows receiver type mismatch. DSL works ok from the v7 AppCompatActivity. In trying to get this to work I have updated to Android Studio 3.0. I have also updated the dependencies in build.gradle's as some other threads suggested.

Here are the dependencies in my app's build.gradle

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:support-v4:25.4.0'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    compile "org.jetbrains.anko:anko:$anko_version"
    compile "org.jetbrains.anko:anko-appcompat-v7-commons:$anko_version"
    compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
    compile "org.jetbrains.anko:anko-support-v4-commons:$anko_version"
    compile "org.jetbrains.anko:anko-support-v4:$anko_version"
}

and the dependencies in project's build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}

I have also seen this Question 'receiver type mismatch' with Fragment and Anko toast

But I am still stuck.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309714 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO