【问题标题】:error: cannot find symbol class StringJoiner in android错误:在 android 中找不到符号类 StringJoiner
【发布时间】:2017-03-01 12:49:59
【问题描述】:

当我使用这个 gradle 依赖项时出现以下错误:

 compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'

有什么方法可以解决这个问题,否则它与 android 不兼容。还有其他使用StringJoiner的方法吗?

error: cannot find symbol class StringJoiner
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

我构建项目时产生的错误。

【问题讨论】:

  • 签入您的代码,可能缺少一些导入
  • 我无法构建它。在我的代码中,我使用 import java.util.StringJoiner;失败了

标签: android apache-commons


【解决方案1】:

确保您的目标版本是 24。StringJoiner 是从 API 24 开始引入的。

如果您支持 StringBuilder。

如需了解区别,请参考here

【讨论】:

    猜你喜欢
    • 2015-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-16
    • 2019-11-01
    • 1970-01-01
    相关资源
    最近更新 更多