rocwong-cn / react-native-aes-kit

AES-CBC-PKCS5Padding
18 stars 16 forks source link

AesCrypto.encrypt is not a function. #6

Open ashish-dhiman opened 5 years ago

ashish-dhiman commented 5 years ago

I am creating a react native project with expo. When I try to run the sample code, I encounter the said error "[Unhandled promise rejection: TypeError: AesCrypto.encrypt is not a function. (In 'AesCrypto.encrypt(plaintxt, secretKey, iv)', 'AesCrypto.encrypt' is undefined)]".

Rotarepmi commented 5 years ago

Any updates to that issue?

michelegoh commented 5 years ago

Have you ejected your app? I don't think this works on Expo projects.

Rotarepmi commented 5 years ago

Yup it won't work on Expo. You have to use plain react-native or ExpoKit. While using ExpoKit you have to publish the project first and then you can use ./android/gradlew installDebug. Should work fine :)