-
Notifications
You must be signed in to change notification settings - Fork 478
fix(android): Bump test dependencies to support jdk17 #775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3373083
to
e921352
Compare
e921352
to
cfb4249
Compare
"key5":"value5", | ||
"key6":{ | ||
"key7":"value7", | ||
"key8":"value8" | ||
} | ||
}, | ||
"key5":"value5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For whatever reason, using includeAndroidResources
option for unit test (required by latest robolectric) changes this order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But… why? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great question!
I tracked it down to changing the includeAndroidResources
and different behavior of JSONObject
.
With includeAndroidResources
, the order of the keys in string is kept within JSON Object, while without it, it's different.
Note this:
Without includeAndroidResources
:
Note the data structure used with each other - includeAndroidResources
uses LinkedHashMap, which keeps the order of data insertion, while HashMap does not. I don't know why different data structure is used with and without the flag, and I'd really want to know!
@renchap |
I changed my
When I build my Android app, I am getting this error:
The only change is using async storage from git, but I dont know if its caused by your branch or by the fact that I am pulling it from git. |
Can you add the following line to
|
It now proceeds but with another error:
FYI, if I add this to my
|
Seems like Gradle issue. |
Good catch, it now builds fine with your branch (Gradle 7.3, |
Coolio, we it seems like a fix to support JDK 17. Thanks for reporting and testing 🙏 |
defaultConfig { | ||
minSdkVersion safeExtGet('minSdkVersion', 21) | ||
targetSdkVersion safeExtGet('targetSdkVersion', 29) | ||
targetSdkVersion safeExtGet('targetSdkVersion', 31) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that this works? We had to revert back to 29 due to a crash on startup: microsoft/react-native-test-app@f873225
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting - why you would have a crash on startup due to targetSdk? It's used as compile time and by IDE (to give you latest warnings/deprecations etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it seems it was a bug in okHttp parsing android version 😄
https://stackoverflow.com/a/64235713
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returnDefaultValues = true | ||
includeAndroidResources = true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to keep this as long as minSdkVersion
is below 24?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting with AGP 4.2, it's 1.8 by default
https://developer.android.com/studio/releases/gradle-plugin#java-8-default
"key5":"value5", | ||
"key6":{ | ||
"key7":"value7", | ||
"key8":"value8" | ||
} | ||
}, | ||
"key5":"value5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But… why? 🤔
🎉 This PR is included in version 1.17.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Bumping dependencies for tests, to support jdk17.
Test Plan
Green CI.