Skip to content
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

[Android]android版本在Release版本,沒有數據的時候偶爾會宕機,debug版本沒有這問題 #4

Closed
EddyDaddy opened this issue Dec 14, 2016 · 7 comments

Comments

@EddyDaddy
Copy link

com.facebook.react.common.JavascriptException: null is not an object (evaluating 'e._footer.setNativeProps'), stack:
@451:10389
@20:120
value@30:3059
@30:1402
d@30:127
value@30:1372

                                                 at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:97)
                                                 at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:81)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                 at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:318)
                                                 at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
                                                 at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                 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:135)
                                                 at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
                                                 at java.lang.Thread.run(Thread.java:818)
@cyqresig
Copy link
Contributor

EddyDaddy 您好,
感谢您提交的问题,会尽快对该问题进行排查和后续修复~

@EddyDaddy
Copy link
Author

是从网络获取数据后,endfresh调用。跟代码是_setPaddingBlank 方法中,目前是加了一层保护
_setPaddingBlank = (paddingDisabled) => {
let innerViewRef = this._scrollView.refs.InnerScrollView || this._scrollView._innerViewRef || this._innerScrollView.refs.InnerScrollView || this._innerScrollView._innerViewRef
innerViewRef.measure((ox, oy, width, height, px, py) => {
if (!paddingDisabled && height - this._paddingBlankDistance < this._scrollViewContainerHeight) {
this._paddingBlankDistance = this._scrollViewContainerHeight - (height - this._paddingBlankDistance)
}
else {
this._paddingBlankDistance = 0
}
if(this._footer){
this._footer.setNativeProps({
style: {
marginTop: this._paddingBlankDistance,
}
})
}
})
}

@cyqresig
Copy link
Contributor

您好,我这里的小米手机暂时还没有试出过您描述的问题。关于这个问题,在上述代码段中增加了this._footer判空的条件语句可以防止报错,但是后续设置marginTop的代码段将不会执行哦。
您试下不判空,通过增加一个定时器的方式是否也能解决您的问题,如果确认可以,我会将此修改提交发布更新版本。
setTimeout( () => {
this._footer.setNativeProps({
style: {
marginTop: this._paddingBlankDistance,
}
})
}, 1 )

@EddyDaddy
Copy link
Author

EddyDaddy commented Dec 16, 2016

嘗試了一下。fetch回來后,延遲2S 設置數據。解決到這個問題。最初在onRefresh的時候,就直接請求網絡獲取數據,如果網絡請求返回很快,就會出現這個問題。謝謝你的即時恢復,thks

@cyqresig
Copy link
Contributor

感谢您的反馈,将会根据您的描述尝试重现并进行问题排查

@cyqresig
Copy link
Contributor

您好,当前版本已针对这个问题作了更新,调整了执行onRefresh的时机,现在应已不需要额外设置延迟执行了。

@EddyDaddy
Copy link
Author

Thks. I will update to 1.6.5.

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

No branches or pull requests

2 participants