3

ネイティブAndroidアプリケーションに反応する React Nativeコマンドラインインターフェイスを開いているときに問題が発生していますが、どうすればいいですか1つは、これに関する私を助けるか、私はデモのアプリを作ることができる場所からのリンクを提供しています。開始ネイティブコマンドラインインターフェイス

+0

を実行できるようにインストールの詳細情報を提供してください。..あなたが試したことと間違ったことを説明してください。単に「私は問題がある」と言っても、問題を特定するのに役立つわけではありません。 – atlanteh

+0

反応のネイティブアプリではじめてです。このリンクを使って何かを取得して、最初のレベルから始めることができます [link](https://facebook.github.io/react-native/releases/next) /docs/getting-started.html) しかし、React Nativeコマンドラインインターフェイスを開く方法がわかりません。 –

答えて

1
1) First of You can node js following info.  
    The React Native CLI 
     Node.js comes with npm, which lets you install the React Native command line interface. 

     Android Development Environment 
     Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps. 

     1. Download and install Android Studio 

     Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps. 

     2. Install the AVD and HAXM 

     Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked: 

     Android SDK 
     Android SDK Platform 
     Performance (Intel ® HAXM) 
     Android Virtual Device 
     Then, click "Next" to install all of these components. 

     If you've already installed Android Studio before, you can still install HAXM without performing a custom installation. 
     3. Install the Android 6.0 (Marshmallow) SDK 

     Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. To install it, launch the SDK Manager, click on "Configure" in the "Welcome to Android Studio" screen. 

     The SDK Manager can also be found within the Android Studio "Preferences" menu, under Appearance & Behavior → System Settings → Android SDK. 
     Select "SDK Platforms" from within the SDK Manager, then check the box next to "Show Package Details". Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the following items are all checked: 

     Google APIs 
     Intel x86 Atom System Image 
     Intel x86 Atom_64 System Image 
     Google APIs Intel x86 Atom_64 System Image 
     Next, select "SDK Tools" and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build Tools" entry, then make sure that Android SDK Build-Tools 23.0.1 is selected. 

     Finally, click "Apply" to download and install the Android SDK and related build tools. 

     4. Set up the ANDROID_HOME environment variable 

     The React Native command line interface requires the ANDROID_HOME environment variable to be set up. 

     Go to Control Panel → System and Security → System → Change settings → Advanced System Settings → Environment variables → New, then enter the path to your Android SDK. 
     Testing your React Native Installation 
     Use the React Native command line interface to generate a new React Native project called "AwesomeProject", then run react-native start inside the newly created folder to start the packager. 

     react-native init AwesomeProject 
     cd AwesomeProject 
     react-native start 
     Open a new command prompt and run react-native run-android inside the same folder to launch the app on your AVD. 

     react-native run-android 
     If everything is set up correctly, you should see your new app running in your Android emulator shortly. 

     If you're targeting API level 23, the app might crash on first launch with an error smilar to Unable to add window [email protected] -- permission denied for this window type. To fix this, you need to go to System settings > Apps > Configure apps > Draw over other apps and grant the permission for the app. 
     NOTE: Many React Native modules haven't been tested on Marshmallow and might break. Please thoroughly test the app if you target API level 23 and file a bug report if you find that something is broken. 

     Modifying your app 
     Now that you have successfully run the app, let's modify it. 

     Open index.android.js in your text editor of choice and edit some lines. 
     Press the R key twice or select Reload from the Developer Menu to see your change! 

    2) And This Demo I am run on Android studio. 
https://github.com/react-native-material-design/demo-app 
5

のNode.jsをインストールして実行します。

npm install react-native-cli -g 

これが反応し、ネイティブ-CLIグローバルコマンドラインを開き、

react-native init AwesomeProject 
+0

ありがとう@atlantehあなたの問題解決に役立ちます。 –