5

I am trying to debug a crash reported by Firebase Crashlytics found in the latest version of my app.

The error seems somewhat obfuscated (despite having uploaded a ProGuard mapping file) and based on the vagueness of the error I am struggling to pinpoint the issue.

I fully understand the Text strings must be rendered within a <Text> component error description - but this error didn't show up in testing and seems to be something to do with the latest release build.

If anyone knows any tips as to how I can pinpoint where this fatal exception is occurring, I would appreciate it.

All I can determine is that the error occurs in a subview of a ScrollView component. Is there anything else that can be taken from this message to help me determine the cause?

Invariant Violation: Invariant Violation: Text strings must be rendered within a component. This error is located at: in RCTView in RCTView in RCTView in RCTView in RCTScrollView in h in RCTView in n in _ in p in RCTView in RCTView in l in RCTView in n in RCTView in u in RCTView in u in PanGestureHandler in n in S in P in p in RCTView in u in RCTView in u in n in n in E in RCTView in n in RCTView in u in PanGestureHandler in n in L in RCTView in n in t in P in v in RCTView in n in A in s in Unknown in RCTView in RCTView in c This error is located at: in A in s in Unknown in RCTView in RCTView in c, stack: v@82:187 Pa@82:69549 _a@82:68342 Ea@82:66044 Ea@-1 xa@82:64787 xa@-1 pn@82:25281 dn@82:25187 Ue@82:81498 Me@82:13499 Fe@82:13672 receiveEvent@82:14058 value@23:3518 @23:822 value@23:2772 value@23:794 value@-1

proguard-rules.pro:

-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

# Crashlytics
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
Oleg Kodysh
  • 986
  • 6
  • 13
jskidd3
  • 4,609
  • 15
  • 63
  • 127
  • Does this error occur when you build? – hong developer Oct 06 '19 at 10:03
  • @hongdevelop No it's occurring at runtime on nearly exclusively Samsung phones – jskidd3 Oct 06 '19 at 10:04
  • Can you show me the code of the file that you expect to have an error? – hong developer Oct 06 '19 at 10:08
  • @jskidd3 did you find the solution? I am facing the same issue. – Bhaskar Dabhi Oct 22 '19 at 08:41
  • @BhaskarDabhi Sadly not. It's affecting about 5% of our users but I've started a bounty as would like to resolve. – jskidd3 Oct 22 '19 at 10:01
  • 1
    @jskidd3 I figured it out. I changed `{this.state.variablename && }` to `{!!this.state.variablename && }` and it worked. It is quite strange though. – Bhaskar Dabhi Oct 22 '19 at 10:05
  • @BhaskarDabhi Thanks for replying. That would make sense as presumably if the loose check on `variablename` fails it would output null? The issue I have is that I can't find the source of where this is happening because the app has many thousands of lines of code split over many files and the crash logs don't contain any relative information about the illegal code. – jskidd3 Oct 22 '19 at 10:09
  • @jskidd3 Did you check the same stack trace on their issue tracker? https://github.com/facebook/react-native/issues/20084 – GensaGames Oct 22 '19 at 16:59
  • @jskidd3 https://stackoverflow.com/questions/52368342/invariant-violation-text-strings-must-be-rendered-within-a-text-component – GensaGames Oct 22 '19 at 17:00
  • @GensaGames As discussed above I understand the cause of the problem but it's finding the location of the specific error that's the problem. The code is obfuscated so I can't determine the line where the error is occurring. I'll rework the title to make it clearer. – jskidd3 Oct 22 '19 at 20:18
  • That would be something very interesting for JSLint to check – diogenesgg Oct 24 '19 at 17:09

0 Answers0