React native Android most common 10 questions

Source: Internet
Author: User

Here are the most easily encountered react native Android-related case:

    • 1. After the app launches, the Red interface, unable load jsbundle:
    1. Workaround: Generally speaking, you are using the Dev-serve way, and your server does not match correctly, if you are running with a mobile phone, you need a PC and mobile phone in the same wifi, and through the menu key set Menu-ip for the PC's IP, if it is the simulator, You do not need to manually set the IP, settings, it will be wrong
    • 2. After the app is launched, the Red interface, Unregisteredproject
    1. Prompt for what, your app is not registered at startup
    2. Solution: This is also a look at the error, is your index.android.bundle in the bottom of the write that
    3. ' Componetnameinyourlocalproject ' In your Java code is not called this name, check it yourself, can immediately repair

    • 3. require ("XXX") component failed
    1. JS code sometimes appears require ("XXX") component Error Resolution: To detect whether the node component exists on your server, if it is your own encapsulated nativemodule can be used directly

    • 4. Commissioning
    1. Solution: You can use the PC-side Chrome Debug tool for JS end debugging, native debugging can only use Logcat tracking, now see most of the errors are their own code problems, reactandroid itself crash less
    • Problems with 5.so libraries
    1. Gradle, the NDK filter can be used to control:

Android {defaultconfig {ndk {abifilters "X86″," armeabi-v7a "}}

    1. MAVEN, you can manually resolve the problem by using the so copy under Libs.
    2. This piece has a bigger pit is that the default introduced Jsc.aar in the Armabi folder, but there is no jsc.so. Cause in many places, to encode the source code when the NDK will error.
    • 6. About Equipment Minsdkverison
    1. Default Android requires more than 4.1 devices (4.0 according to the network data about 0.7 ratio, as most apps already do not support under 4.0 devices, this block is also acceptable)
    2. Just started to use a 5.0 device for Reactandorid testing and development, and then the direction, in fact, make a 5.0+ genymotion simulator, the efficiency will be higher.
    • 7.UIExplorer Demo Problem
    1. have been looking at the specific access and code implementation aspects, when the head of the work back to see, in fact, then should start from this uiexploror, efficiency and progress should be greatly improved.
    2. This need to compile react source code, if you encounter https://github.com/facebook/react-native/issues/3976 problem, you can use the method I reply below the hook, but the essential reason is the Armabi Jsc.so's Problem

    • 8. Capacity Coverage
    1. Based on the team's prior experience with iOS, follow up the skeleton code and rely on the UI components provided by the RN itself to meet most of the business scenarios react.
    2. Of course, if you want to reuse before the team precipitation, with the Uimanager and uimodule this piece of its own workload to also not too big.
    3. But should be as far as possible and the team after the JS and iOS end of the protocol interface to maintain consistency, so that react the greatest significance to play out, "lean once run everywhere"
    • 9. Data security
    1. Prior to 0.14, only DEV-PC and assert were supported, and local file patch loading was supported from the 0.14.0 realease version, with the latest version 0.15.1.
    2. Because if you want to dynamic capabilities, JS must be on the network side issued, JS itself is clear (even if JS is confused), data protection against hijacking or must do, this can be combined with HTTPS anti-tamper +sign check to do
    • Impact of 10.JNI message rotation
    1. Because of the JNI communication restrictions, the Java layer and the Native communication are unidirectional, and in order to ensure that RN 16ms rendering frequency, all Java-native-jscore layer communication is asynchronous, which may be a performance issue for the Java layer UI rendering.
    2. When the message volume is very large or the ListView page is very complex, the rendering of each 1-layer cell requires a continuous drawing of the UI thread in the Css-scrowllerview model, and there may be performance problems with the waterfall stream being responsible for the ListView. But the problem itself must be better than the H5 experience.

Ext.: http://codecloud.net/react-native-android-10-problems-6573.html

React native Android most common 10 questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.