react native debug版本正常,release版本崩溃



  • com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'p.View.propTypes.style'), stack:
    <unknown>@435:7571
    d@2:768
    n@2:409
    t@2:262
    <unknown>@434:32
    d@2:768
    n@2:409
    t@2:262
    <unknown>@390:332
    d@2:768
    n@2:409
    t@2:262
    <unknown>@389:99
    d@2:768
    n@2:409
    t@2:262
    <unknown>@304:132
    d@2:768
    n@2:409
    t@2:262
    <unknown>@303:141
    d@2:768
    n@2:409
    t@2:262
    <unknown>@12:42
    d@2:768
    n@2:339
    t@2:262
    global code@871:8

                                                       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:754)
                                                       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:163)
                                                       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
                                                       at java.lang.Thread.run(Thread.java:760)


  • evaluating 'p.View.propTypes.style' ?



  • View.propTypes改为ViewPropTypes就可以了