linux平台安装React Native遇到的坑
生活随笔
收集整理的這篇文章主要介紹了
linux平台安装React Native遇到的坑
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
3年前我在windows平臺安裝過React Native,我一直都記憶猶新,那個時候facebook剛推出支持安卓,然后花了一天的時間在自己的window電腦上配置好了,還是很興奮的,安裝博客地址如下
Android之Windows下搭建React Native Android開發環境(差不多搞了一天)
現在我的開發環境是ubuntu,所以需要在這個平臺安裝react native,遇到的坑如下
?
問題?? 1
ERROR Metro Bundler can't listen on port 8081解決辦法
因為有地方占用了8081端口,所以找到這個端口的進程pid,然后kill就行
sudo lsof -i :8081 kill pid?
?
?
問題 2
A problem occurred configuring project ':app'. > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.解決辦法
這個在我們react native init program里面我們項目里面的android文件夾里面少了local.properties文件,在之前的項目目錄下,把這個文件拷貝到這個目錄就行了
?
最后編譯好的部分顯示如下
../react-native run-android :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareAndroidArchLifecycleRuntime100Library :app:prepareComAndroidSupportAnimatedVectorDrawable2610Library :app:prepareComAndroidSupportAppcompatV72610Library :app:prepareComAndroidSupportSupportCompat2610Library :app:prepareComAndroidSupportSupportCoreUi2610Library :app:prepareComAndroidSupportSupportCoreUtils2610Library :app:prepareComAndroidSupportSupportFragment2610Library :app:prepareComAndroidSupportSupportMediaCompat2610Library :app:prepareComAndroidSupportSupportV42610Library :app:prepareComAndroidSupportSupportVectorDrawable2610Library :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library :app:prepareComFacebookFrescoDrawee190Library :app:prepareComFacebookFrescoFbcore190Library :app:prepareComFacebookFrescoFresco190Library :app:prepareComFacebookFrescoImagepipeline190Library :app:prepareComFacebookFrescoImagepipelineBase190Library :app:prepareComFacebookFrescoImagepipelineOkhttp3190Library :app:prepareComFacebookReactReactNative0561Library :app:prepareComFacebookSoloaderSoloader030Library :app:prepareOrgWebkitAndroidJscR174650Library :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:bundleDebugJsAndAssets SKIPPED :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:javaPreCompileDebug :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk NO-SOURCE :app:compileDebugSources UP-TO-DATE :app:transformClassesWithDexForDebug UP-TO-DATE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE :app:transformNativeLibsWithStripDebugSymbolForDebug UP-TO-DATE :app:processDebugJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE :app:validateSigningDebug :app:packageDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE :app:installDebug Installing APK 'app-debug.apk' on 'HUAWEI RIO-UL00 - 6.0.1' for app:debug Installed on 1 device.BUILD SUCCESSFUL?
總結
以上是生活随笔為你收集整理的linux平台安装React Native遇到的坑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言之在结构体里面放很多函数指针
- 下一篇: node.js之npm