Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Update androidx.test.ext:junit version #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emanuelboros
Copy link

This fixes an error while building ui test apk version with targetSdkVersion:31

@emanuelboros
Copy link
Author

@emeraldsanto Can you take a look on this?

@Marthyn
Copy link

Marthyn commented Jul 7, 2022

@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

@camchis
Copy link

camchis commented Nov 30, 2022

@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.

@Gerjan98
Copy link

Gerjan98 commented Dec 2, 2022

+1, please take a look

@gregmarut
Copy link

@emeraldsanto can we get this merged?

@GeorgeNiotis
Copy link

@emanuelboros @monostere0 @hssrrw @mlowijs @alesharik
Can someone from the contributors plz merge that

@gregmarut
Copy link

gregmarut commented Feb 15, 2023

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'

@emanuelboros
Copy link
Author

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.

Copy link

@JordaoViktor JordaoViktor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update needed.

@px-amaac
Copy link

This needs to be updated again to a new version. 1.1.5

#110

@emanuelboros
Copy link
Author

@px-amaac @JordaoViktor
@everyoneelse

  1. 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.

@coderaven
Copy link

coderaven commented Jul 17, 2023

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');\""

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants