Android Project Integration React Native 0.44 Note: androidreact

Source: Internet
Author: User

Android Project Integration React Native 0.44 Note: androidreact

Currently (May 22, 2017) React Native development is quite popular, but there is no integration tutorial for the latest version 0.44 after searching, so I tried to integrate it into the Android Native project. This article aims to record the problems and response methods.

1. the integration process is relatively simple. Follow the steps in this tutorial:

English Tutorial: http://reactnative.cn/docs/0.44/integration-with-existing-apps.html#content

English Tutorial: http://facebook.github.io/react-native/docs/integration-with-existing-apps.html

 

2. After the integration is completed according to the above tutorial, an error occurs:

1,Error: Conflict with dependency 'com. google. code. findbugs: jsr305'

-- This stackoverflow has an answer. The solution adopted by the author is to add androidTestCompile 'com. google. code. findbugs: jsr305: 3.0.0 'to build. gradle of the app '.

 

2,Java. lang. IllegalAccessError: Method 'void android.support.v4.net. ConnectivityManagerCompat. () 'is inaccessible to class 'com. facebook. react. modules. netinfo. NetInfoModule'

-- This issue is also mentioned in facebook's issue and 6152. You need to modify the support package version to 23.0.1: compile 'com. android. support: appcompat-v7: 23.0.1 'and compile 'com. android. support: design: 23.0.1 '. And gradle. properties (Add at the end of the file, android. useDeprecatedNdk = true ). Note that after this modification, the app: srcCompat of the Image attribute in the layout file will not be recognized, but it will be changed to android: src. For the solution, refer to https://github.com/kennytian/embedded6th.

 

3,Unable to resolve module 'react/lib/reactdebugcurrentframework' or Unable to resolve module 'react/lib/reactcomponentwithpurerendermixin'

-- Note that there may be similar information when installing according to the tutorial 'npm WARN react-native@0.44.0 requires a peer of react @~ 16.0.0-alpha.6 but none was installed. 'search and find that npm install -- save react-native will make the installation version mismatched. Run the following command:npm install --save react@16.0.0-alpha.6 react-native

 

4,Can't find variable: _ fbBatchedBridge

-- Check whether npm start runs successfully or try adb reverse tcp: 8081 tcp: 8081. If the error persists, refer to here.

 

5,Check whether the react native version in the android project external libraries is 0.44: If not, modify

Maven {'url "$ rootDir /.. /node_modules/react-native/android "'// correct address} modify url" $ rootDir */.. */node_modules/react-native/android "is url" $ rootDir/node_modules/react-native/android "(from the short book)

 

ReactNative is added to the most detailed Android native APP in the history for reference.

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.