首页 > 解决方案 > Cannot resolve symbol "Base64" while importing apache commons codec

问题描述

I am working on writing an encryption class to encrypt/decrypt data with a key on Java 1.7 with Android Studio.

Since I can't use Java 1.8 Base64, i'm trying to do it with org.apache.commons.codec.binary.Base64, and even if the app runs and doesn't seems to encounter any error, Android Studio is marking an error on the import statement for apache commons Base64.

I'm declaring apache commons codec as a dependency in build.gradle like that:

dependencies {
    ....
    implementation 'commons-codec:commons-codec:1.14'
}

and Android Studio shows that:

Android Studio error

What is happening and how do I get rid of that error?

标签: javaandroid-studioimportapache-commons

解决方案


Looks like I resolved that by deleting the import line in the editor and running the application then writing the line back..


推荐阅读