After a lot of struggle, I've managed to install your library. Based on the issues I've had, I'll explain here what I've done to successfully install the library. Also, this is a suggestion to edit the current readme file.
- In the Getting started guide, please add this line for installation via npm:
npm install https://github.com/quan-to/react-native-pbkdf2
- After installation link the library (
react-native link react-native-pbkdf2), even though newer versions of react-native support auto link
- Add PBKDF2 to your project:
import PBKDF2 from 'react-native-pbkdf2'
PBKDF2.derivationKey('P4S5W0RD', '032145', 10000)
.then((derivationKey) => console.log(`Derivation key: ${derivationKey}`))
.catch((err) => console.error(err));
⚠ Readme edit suggestion:
- Add installation via npm, as described above
- No need to add
new PBKDF2Package() in the getPackages() method. You only need to import the module
- Replace
compile with api since compile is deprecated
- During the installation I've encountered a Too many field references. Check out minSdkVersion in your
android/src/build.gradle if the number is below 21, you need to add multiDexEnabled true flag after the specified version
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 28
👉 multiDexEnabled true
}
After a lot of struggle, I've managed to install your library. Based on the issues I've had, I'll explain here what I've done to successfully install the library. Also, this is a suggestion to edit the current readme file.
npm install https://github.com/quan-to/react-native-pbkdf2react-native link react-native-pbkdf2), even though newer versions of react-native support auto link⚠ Readme edit suggestion:
new PBKDF2Package()in thegetPackages()method. You only need to import the modulecompilewithapisincecompileis deprecatedandroid/src/build.gradleif the number is below 21, you need to addmultiDexEnabled trueflag after the specified version