日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
快速上手ReactNative

React Native 是facebook 開(kāi)源的一套用于開(kāi)發(fā)移動(dòng)端跨平臺(tái)App的技術(shù)框架,下面為大家講解一下React Native安裝和使用。

公主嶺網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站,公主嶺網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為公主嶺上千多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)要多少錢(qián),請(qǐng)找那個(gè)售后服務(wù)好的公主嶺做網(wǎng)站的公司定做!

環(huán)境

  1. 安裝homebrew
  2. 安裝nodejs
  3. 安裝watchman、flow
  4. 安裝react-native

新建項(xiàng)目

react-native init JustNoCode

執(zhí)行之后,一直卡在Installing react-native package from npm…,但是, 我等了兩天,終于成功了:

@feng   github  react-native init JustNoCodeprompt: Directory JustNoCode already exist. Continue?:  (no) yThis will walk you through creating a new React Native project in /Users/fengjian/Code/github/JustNoCodeInstalling react-native package from npm...Setting up new React Native app in /Users/fengjian/Code/github/JustNoCodecreate .gitignorecreate .watchmanconfigcreate index.ios.jscreate index.Android.jscreate ios/main.jsbundlecreate ios/JustNoCode/AppDelegate.hcreate ios/JustNoCode/AppDelegate.mcreate ios/JustNoCode/Base.lproj/LaunchScreen.xibcreate ios/JustNoCode/Images.xcassets/AppIcon.appiconset/Contents.jsoncreate ios/JustNoCode/Info.plistcreate ios/JustNoCode/main.mcreate ios/JustNoCodeTests/JustNoCodeTests.mcreate ios/JustNoCodeTests/Info.plistcreate ios/JustNoCode.xcodeproj/project.pbxprojcreate ios/JustNoCode.xcodeproj/xcshareddata/xcschemes/JustNoCode.xcschemecreate android/app/build.gradlecreate android/app/proguard-rules.procreate android/app/src/main/AndroidManifest.xmlcreate android/app/src/main/res/values/strings.xmlcreate android/app/src/main/res/values/styles.xmlcreate android/build.gradlecreate android/gradle.propertiescreate android/settings.gradlecreate android/app/src/main/res/mipmap-hdpi/ic_launcher.pngcreate android/app/src/main/res/mipmap-mdpi/ic_launcher.pngcreate android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngcreate android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngcreate android/gradle/wrapper/gradle-wrapper.jarcreate android/gradle/wrapper/gradle-wrapper.propertiescreate android/gradlewcreate android/gradlew.batcreate android/app/src/main/Java/com/justnocode/MainActivity.javaTo run your app on iOS:Open /Users/fengjian/Code/github/JustNoCode/ios/JustNoCode.xcodeproj in XcodeHit Run buttonTo run your app on Android:Have an Android emulator running, or a device connectedcd /Users/fengjian/Code/github/JustNoCodereact-native run-android

顯示詳細(xì)信息

運(yùn)行Android

react-native run-android

結(jié)果報(bào)錯(cuò),如下:

@feng   JustNoCode (master)  react-native run-androidStarting JS server...Building and installing the app on the device (cd android && ./gradlew installDebug)...Download https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pomDownload https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.pom... ...Download https://jcenter.bintray.com/com/android/tools/lint/lint-api/24.3.1/lint-api-24.3.1.jarFailed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.    at com.android.build.gradle.internal.SdkHandler.getAndCheckSdkFolder(SdkHandler.java:102)    ... ...    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMainin.java:61)FAILURE: Build failed with an exception.* Where:Build file '/Users/fengjian/Code/github/JustNoCode/android/app/build.gradle' line: 20* What went wrong:A problem occurred evaluating project ':app'.> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILEDTotal time: 52.605 secsCould not install the app on the device, see the error above.

顯示詳細(xì)信息

在.zshrc中配置一下ANDROID_HOME:

export ANDROID_HOME=~/Tools/android-sdk

再運(yùn)行一次,

@feng   JustNoCode (master)  react-native run-androidJS server already running.Building and installing the app on the device (cd android && ./gradlew installDebug)...:app:preBuild UP-TO-DATE... ...:app:installDebugInstalling APK 'app-debug.apk' on 'Google Nexus S - 4.1.1 - API 16 - 480x800 - 4.1.1'Installed on 1 device.BUILD SUCCESSFULTotal time: 10.294 secsThis build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.htmlStarting the app (/Users/fengjian/Tools/android-sdk/platform-tools/adb shell am start -n com.justnocode/.MainActivity)...Starting: Intent { cmp=com.justnocode/.MainActivity }

顯示詳細(xì)信息

成功了,顯示了MainActivity,一個(gè)簡(jiǎn)單的說(shuō)明頁(yè)面,


網(wǎng)站名稱(chēng):快速上手ReactNative
鏈接URL:http://www.dlmjj.cn/article/ccoesde.html