错误:(3,0)原因:org / apache / commons / lang3 / StringUtils

高拉夫

我收到以下错误

错误:(3,0)原因:org / apache / commons / lang3 / StringUtils

当我尝试在Android项目中添加数据绑定时。

我的依赖项包括:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha7'
        classpath 'me.tatarka:gradle-retrolambda:3.2.2'
        classpath 'com.android.databinding:dataBinder:1.0-rc1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我的gradle包装器是:distributionUrl = https://services.gradle.org/distributions/gradle-2.2.1-all.zip

我的gradle文件:

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.android.databinding'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.quizviz.workbook.myworkbook"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'

    compile 'io.reactivex:rxandroid:1.1.0'
    compile 'io.reactivex:rxjava:1.1.0'
    compile 'com.jakewharton.rxbinding:rxbinding:0.2.0'
    compile 'com.jakewharton:butterknife:7.0.1'



    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
    compile 'com.squareup.retrofit2:converter-jackson:2.0.0-beta3'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'
    compile 'com.squareup.okhttp3:okhttp:3.0.1'
    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'

}
曾洁仪

我花了一段时间才注意到这个问题是由Google更新使用数据绑定库的方式引起的。您可以从此处查看更多信息:http : //developer.android.com/tools/data-binding/guide.html

您只需删除以下两行代码:

apply plugin: 'com.android.databinding'

而这个在buildscript的依赖项中:

classpath 'com.android.databinding:dataBinder:1.0-rc1'

然后像这样将dataBinding部分添加到build.gradle中。

buildscript {
    ...
}

android {
    ...

    dataBinding {
        enabled = true
    }
    ...

}

dependencies {
    ...
}

干得好。这对我有用:)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

NoClassDefFoundError:org / apache / commons / lang3 / StringUtils

来自分类Dev

NoClassDefFoundError:org.apache.commons.lang.StringUtils

来自分类Dev

org.apache.commons.lang3.StringUtils 与 org.apache.logging.log4j.util.Strings

来自分类Dev

为什么无法导入org.apache.commons.lang.StringUtils?

来自分类Dev

用Scala做apache commons lang3的方法验证吗?

来自分类Dev

用Scala做apache commons lang3的方法验证吗?

来自分类Dev

奇怪的Apache Commons Lang StringUtils.join结果

来自分类Dev

Apache Commons Lang 2与3

来自分类Dev

使用 stringutils commons.lang version3 转义 XML 适用于编写器

来自分类Dev

offset参数如何在org.apache.commons.lang.StringUtils包中的abbreviate(String str,int offset,int maxWidth)函数中工作

来自分类Dev

无法导入org.apache.commons.lang3.math.NumberUtils

来自分类Dev

在commons lang3中使用StringEscapeUtils.escapeJavaScript()的替代方法

来自分类Dev

Java:从没有 lang3 utils 和 StringUtils 的字符串中获取子字符串

来自分类Dev

apache.commons.lang3.DateUtils.setMonths与十二月

来自分类Dev

抛出java.lang.ClassNotFoundException:所造成org.apache.commons.lang3.builder.EqualsBuilder

来自分类Dev

如何导入org.apache.commons.lang3.ArrayUtils;进入Eclipse

来自分类Dev

如何修复NullPointerException“ org.apache.commons.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION_AS_ENUM”为空?

来自分类Dev

从org.apache.commons.lang3.builder.ToStringStyle访问NO_CLASS_NAME_STYLE字段时出错

来自分类Dev

java.lang.ClassNotFoundException:org.apache.commons.lang.UnhandledException

来自分类Dev

org.apache.commons.lang.SerializationException:java.lang.ClassNotFoundException

来自分类Dev

java.lang.ClassNotFoundException:org.apache.commons.lang.UnhandledException

来自分类Dev

Apache Commons StringUtils.repeat()的工作方式以及为什么以这种方式工作?

来自分类Dev

Apache Commons StringUtils.repeat()的工作方式以及为什么以这种方式工作?

来自分类Dev

java.lang.NoClassDefFoundError:org / apache / commons / collections / Transformer

来自分类Dev

java.lang.NoClassDefFoundError:org / apache / commons / io / output / DeferredFileOutputStream

来自分类Dev

java.lang.ClassNotFoundException:org.apache.commons.fileupload.FileItemFactory

来自分类Dev

java.lang.NoClassDefFoundError:org / apache / commons / pool / impl / GenericObjectPool

来自分类Dev

java.lang.ClassNotFoundException:org.apache.commons.fileupload.FileItemFactory

来自分类Dev

#java.lang.NoClassDefFoundError:org / apache / commons / digester / Digester

Related 相关文章

  1. 1

    NoClassDefFoundError:org / apache / commons / lang3 / StringUtils

  2. 2

    NoClassDefFoundError:org.apache.commons.lang.StringUtils

  3. 3

    org.apache.commons.lang3.StringUtils 与 org.apache.logging.log4j.util.Strings

  4. 4

    为什么无法导入org.apache.commons.lang.StringUtils?

  5. 5

    用Scala做apache commons lang3的方法验证吗?

  6. 6

    用Scala做apache commons lang3的方法验证吗?

  7. 7

    奇怪的Apache Commons Lang StringUtils.join结果

  8. 8

    Apache Commons Lang 2与3

  9. 9

    使用 stringutils commons.lang version3 转义 XML 适用于编写器

  10. 10

    offset参数如何在org.apache.commons.lang.StringUtils包中的abbreviate(String str,int offset,int maxWidth)函数中工作

  11. 11

    无法导入org.apache.commons.lang3.math.NumberUtils

  12. 12

    在commons lang3中使用StringEscapeUtils.escapeJavaScript()的替代方法

  13. 13

    Java:从没有 lang3 utils 和 StringUtils 的字符串中获取子字符串

  14. 14

    apache.commons.lang3.DateUtils.setMonths与十二月

  15. 15

    抛出java.lang.ClassNotFoundException:所造成org.apache.commons.lang3.builder.EqualsBuilder

  16. 16

    如何导入org.apache.commons.lang3.ArrayUtils;进入Eclipse

  17. 17

    如何修复NullPointerException“ org.apache.commons.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION_AS_ENUM”为空?

  18. 18

    从org.apache.commons.lang3.builder.ToStringStyle访问NO_CLASS_NAME_STYLE字段时出错

  19. 19

    java.lang.ClassNotFoundException:org.apache.commons.lang.UnhandledException

  20. 20

    org.apache.commons.lang.SerializationException:java.lang.ClassNotFoundException

  21. 21

    java.lang.ClassNotFoundException:org.apache.commons.lang.UnhandledException

  22. 22

    Apache Commons StringUtils.repeat()的工作方式以及为什么以这种方式工作?

  23. 23

    Apache Commons StringUtils.repeat()的工作方式以及为什么以这种方式工作?

  24. 24

    java.lang.NoClassDefFoundError:org / apache / commons / collections / Transformer

  25. 25

    java.lang.NoClassDefFoundError:org / apache / commons / io / output / DeferredFileOutputStream

  26. 26

    java.lang.ClassNotFoundException:org.apache.commons.fileupload.FileItemFactory

  27. 27

    java.lang.NoClassDefFoundError:org / apache / commons / pool / impl / GenericObjectPool

  28. 28

    java.lang.ClassNotFoundException:org.apache.commons.fileupload.FileItemFactory

  29. 29

    #java.lang.NoClassDefFoundError:org / apache / commons / digester / Digester

热门标签

归档