react-native-encrypted-storage
react-native-encrypted-storage copied to clipboard
Update androidx.test.ext:junit version
This fixes an error while building ui test apk version with targetSdkVersion:31
@emeraldsanto Can you take a look on this?
@emeraldsanto +1 for this, it is required for targetAndroidSDK 31. Running into issues building a testbuild with Detox. Can confirm this fixes it.
I followed this stackoverflow answer https://stackoverflow.com/a/71605255/913824
@emeraldsanto We have bumped up our targetSdkVersion
to 31 and running into issues as well, can confirm this fixes the test errors we are getting.
+1, please take a look
@emeraldsanto can we get this merged?
@emanuelboros @monostere0 @hssrrw @mlowijs @alesharik Can someone from the contributors plz merge that
In the meantime, I fixed this locally for my project with patch-package (https://www.npmjs.com/package/patch-package)
diff --git a/node_modules/react-native-encrypted-storage/android/build.gradle b/node_modules/react-native-encrypted-storage/android/build.gradle
index b762894..e4f213d 100644
--- a/node_modules/react-native-encrypted-storage/android/build.gradle
+++ b/node_modules/react-native-encrypted-storage/android/build.gradle
@@ -125,7 +125,7 @@ dependencies {
testImplementation 'junit:junit:4.13.1'
- androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
//noinspection GradleDependency
androidTestImplementation 'org.mockito:mockito-android:3.4.6'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Unfortunately this still stands in the open state. Maybe @emeraldsanto will reply to us why? There was activity on this particulary library since this fix was created.
We needed this fix quite urgently in our project so I would sugest to use what @gregmarut sugested, or create a fork and use it your own fork.
This needs to be updated again to a new version. 1.1.5
https://github.com/emeraldsanto/react-native-encrypted-storage/issues/110
@px-amaac @JordaoViktor
@everyoneelse
- As mentioned in my last comment regarding this PR, you should do it yourselfs as a patch. But now reconsidering everything I would not recomend using this package anymore. Not mentained anymore at all
try using other packages instead, search for mmkv. That seems to be the best alternative atm, and they claim it's the fastest storage and offers even sync calls not only async.
Made a workaround.
Hi @emanuelboros and @everyonelse, I added this to my postinstall script under scripts
in package.json (yarn) so that on every yarn install, it automatically replaces the outdated version with the newer one.
Made it with node instead of a shell command to avoid issues with varying OS.
"postinstall": "node -e \"const fs = require('fs'); const content = fs.readFileSync('node_modules/react-native-encrypted-storage/android/build.gradle', 'utf-8'); const modifiedContent = content.replace(/androidTestImplementation 'androidx.test.ext:junit:1.1.2'/g, 'androidTestImplementation \\'androidx.test.ext:junit:1.1.5\\''); fs.writeFileSync('node_modules/react-native-encrypted-storage/android/build.gradle', modifiedContent, 'utf-8');\""