-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(android): 279 - Fix error cannot find symbol #281
Conversation
@jdnichollsc i think it should work, let me try it |
@reberthkss awesome, let me know! <3 |
Personally I don't like Reflection, but I can't see any other option 🤔 |
I've tested on my project and the error was gone, but I faced the same problem with I'm trying to test in a bare react-native typescript template project |
Ohh very odd, please let me know! 🙏 |
Worked like a charm :3 2021-07-03.20-28-16.mp4 |
@@ -62,6 +63,26 @@ | |||
private Activity currentActivity; | |||
private static final Pattern animationIdentifierPattern = Pattern.compile("^.+:.+/"); | |||
|
|||
public Integer setColor(CustomTabsIntent.Builder builder, final ReadableMap options, String key, String method, String colorName) { | |||
String colorString = ""; |
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.
can be String colorString = options.getString(key);
?
and further on try/catch block :
String colorString = options.getString(key);
...
try {
if (colorString != null) {
...
}
...
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.
We need to validate if the key exist first, using options.hasKey(key)
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.
@reberthkss did you find another bug?
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.
just for known more, the response from getString
function is Nullable, so if the key doesn't exist the colorString
variable was null, alright? Why don't follow this approach? Is it a bad practice/insecure?
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.
Oh no, this validation is old, if you want I can change it, no problem, thanks for noticing!
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.
Done!
@reberthkss nice! thanks for your help! 🤩 |
The new release version 3.6.2 its works as well right Now in my app built with React Native version 0.61.5 , thanks for the fixing so i can use the lastest version of this library @jdnichollsc @reberthkss <3 |
Fix
Build failed. Error cannot find symbol builder.setNavigationBarColor
error for Android SupportPR Checklist
What is the current behavior?
Android Support is not working with the new methods of
CustomTabsIntent.Builder
forAndroidX
.What is the new behavior?
Detect if the method exists before to invoke the function to avoid build issues by using Reflection.
Fixes/Implements/Closes #279.