Panagiotis Drakatos
Panagiotis Drakatos

Reputation: 3264

error: cannot find symbol class StringJoiner in android

I am getting the below error when I use this gradle dependency:

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

is any way to fix this or it is incompatible with android. Is any others ways to use StringJoiner?

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

The error created when I build the project.

Upvotes: 1

Views: 1193

Answers (1)

user1506104
user1506104

Reputation: 7106

Make sure that your target version is 24. StringJoiner was introduced starting API 24.

If you support <= API 24, consider using StringBuilder.

To know the difference, please refer here.

Upvotes: 1

Related Questions