React Native 报错



  • t: Exception in native call from JS
    java.lang.NullPointerException
    at com.facebook.common.internal.Preconditions.checkNotNull(Preconditions.java:210)
    at com.facebook.imagepipeline.request.ImageRequestBuilder.setSource(ImageRequestBuilder.java:103)
    at com.facebook.imagepipeline.request.ImageRequestBuilder.newBuilderWithSource(ImageRequestBuilder.java:47)
    at com.facebook.react.views.image.ReactImageView.maybeUpdateView(ReactImageView.java:279)
    at com.facebook.react.views.image.ReactImageManager.onAfterUpdateTransaction(ReactImageManager.java:145)
    at com.facebook.react.views.image.ReactImageManager.onAfterUpdateTransaction(ReactImageManager.java:26)
    at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:43)
    at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:213)
    at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:147)
    at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:673)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:723)
    at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
    at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:120)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:723)
    at android.view.Choreographer.doCallbacks(Choreographer.java:555)
    at android.view.Choreographer.doFrame(Choreographer.java:524)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4819)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)
    是什么原因导致的。



  • Image 标签设置的source不合法(可能是undefined)



  • @tdzl2003 多谢多谢,找了半天是这个原因


登录后回复