Android rreact native common error summary

Android rreact native common error summary

1.invariant violation:expected a component class,got[object object]

When creating custom components, the first letter should be capitalized, otherwise an error will be reported

2.Module 0 is not a registered callable module.

Upgrade gradle to the latest version (CD Android, enter the Android directory and execute: sudo. / gradlew clean) or upgrade through the Android studio tool

3.android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?

This error belongs to Android native. If the referenced activity does not exist or has been destroyed, this error will be reported if it is referenced again. If react native calls the native control, the control creation needs to reference: getcurrentactivity()

4.android.app.Application cannot be cast to com.facebook.React.ReactApplication

The created mainapplication needs to be configured in androidmanifest.xml

5.Element type is invalid: expected a string (for built-in components) or a class/function but got: object

In case of native, you usually refer to an invalid component. If the component is correct, check whether the referenced component is exported normally: (export default)

6.react native undefined is not an object (evaluating this....

This error is usually caused by forgetting bind (this). If this is needed in the callback function, bind is generally required

7.react native - expected a component class,got [object Object]

This error may be that you have referenced a lowercase component. The component must be capitalized. For example, < login / > should be written as < login / >

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>