react-native-keychain: react-native-keychain version 3.1.1 compileDebugJavaWithJavac FAILED
When I building projet, throw this error. How can solve this?
> Task :react-native-keychain:compileDebugJavaWithJavac FAILED
node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/cipherSt
orage/CipherStorageKeystoreAESCBC.java:28: error: cannot find symbol
import android.security.keystore.StrongBoxUnavailableException;
^
symbol: class StrongBoxUnavailableException
location: package android.security.keystore
node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/cipherStorage/CipherStorageKeystoreAESCBC.java:266: error: cannot find symbol
@TargetApi(Build.VERSION_CODES.P)
^
symbol: variable P
location: class VERSION_CODES
node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/cipherStorage/CipherStorageKeystoreAESCBC.java:270: error: cannot find symbol
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
^
symbol: variable P
location: class VERSION_CODES
node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/cipherStorage/CipherStorageKeystoreAESCBC.java:274: error: cannot find symbol
return generateKey(getKeyGenSpecBuilder(service).setIsStrongBoxBacked(true).build());
^
symbol: method setIsStrongBoxBacked(boolean)
location: class Builder
node_modules/react-native-keychain/android/src/main/java/com/oblador/keychain/cipherStorage/CipherStorageKeystoreAESCBC.java:275: error: cannot find symbol
} catch (StrongBoxUnavailableException e) {
^
symbol: class StrongBoxUnavailableException
location: class CipherStorageKeystoreAESCBC
5 errors
System: OS: macOS 10.14.1 Shell: 3.2.57 - /bin/bash Binaries: Yarn: 1.13.0 - /usr/local/bin/yarn npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.57.8 => 0.57.8
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 16
Commits related to this issue
- Bumped compileSdkVersion Ref: https://github.com/oblador/react-native-keychain/issues/193#issuecomment-463599455 — committed to appdevdesigns/adroit-mobile by grahammcculloch 5 years ago
@vdpdev @burhanyilmaz what version of Android SDK do you use?
build.gradleof your app (android/app/build.gradle)? Does changing itcompileSdkVersion 28help?I had this config but the project was cannot be compiled
After I changed to this config my project have been compiled
file
android/build.gradleFor those who lands here from Google search, the solution is here: https://github.com/oblador/react-native-keychain/issues/193#issuecomment-463599455
Very nice @mandrigin . “StrongBox” seems to be a good improvement for keys storage !
@Thebarda the new version of react-native-keychain supports what is called “strongbox” for better encryption keys storage, it requires API level 28: https://proandroiddev.com/android-keystore-what-is-the-difference-between-strongbox-and-hardware-backed-keys-4c276ea78fd0?gi=9b63fdc7e1e2
@Thebarda if you don’t want to increase
compileSdkVersionto 28 you can setreact-native-keychainstrict to3.0.0like this"react-native-keychain": "3.0.0",This way is worked for me withcompileSdkVersion= 27