我正面临着Android发布版本的奇怪痕迹:
com.facebook.react.common.JavascriptException: TypeError: undefined is not a function (evaluating 'i(e)')
This error is located at:
in TextInput
in Unknown
in RCTView
in r
in RCTView
in a
in Connect(a)
in n
in s
in RCTView
in RCTView
in t, stack:
ref@367:381
commitAttachRef@49:102005
R@49:119322
P@49:118134
k@49:117558
T@49:116698
h@49:115914
d@49:115602
t@49:66915
updateContainer@49:133602
render@49:72179
exports@284:730
run@280:615
runApplication@280:2046
value@27:3582
<unknown>@27:1067
value@27:3009
value@27:1039
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:56)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:40)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:761)
Lib依赖关系如下:
"dependencies": {
"android-versions": "^1.3.0",
"glamorous-native": "^1.3.0",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"npm": "^5.7.1",
"numeral": "^2.0.6",
"prop-types": "^15.6.1",
"react": "^16.3.0-alpha.1",
"react-moment": "^0.7.0",
"react-native": "0.54.0",
"react-native-animatable": "^1.2.4",
"react-native-autofocus": "0.0.6",
"react-native-calendars": "^1.17.3",
"react-native-firebase": "^3.2.7",
"react-native-localization": "^0.2.3",
"react-native-masked-text": "^1.6.5",
"react-native-navigation": "^1.1.398",
"react-native-wheel-picker": "^1.2.0",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"seamless-immutable": "^7.1.3",
"tinycolor2": "^1.4.1"
从追踪中很难找出造成问题的原因。是否有一些工具或方法可以找到解决此问题的方法?
我在TextInput
包含的初始屏幕中有2个Form
个组件:
<Form>
<TextInput
style={styles.input}
placeholder={Strings.emailHint}
keyboardType="email-address"
autoCapitalize="none"
underlineColorAndroid="transparent"
onChangeText={text => this.setState({ email: text })}
/>
<TextInput
style={styles.input}
placeholder={Strings.passwordHint}
secureTextEntry
autoCapitalize="none"
underlineColorAndroid="transparent"
onChangeText={text => this.setState({ password: text })}
/>
</Form>
如果删除上述组件,则应用不会崩溃。
注意:开发版本不会崩溃。
感谢。
答案 0 :(得分:0)
依赖react-native-autofocus
似乎是根本问题。不确定它有什么问题,但决定将重点放在TextInput
传统方式:https://medium.com/reactnative/tabbing-through-input-fields-ef283f923ab1