1. 程式人生 > >react-native-camera 填坑

react-native-camera 填坑

安裝過程無法編譯, 按以下方法修正


A mix of things worked for me.


  react: 16.3.1 => 16.3.1
  react-native: 0.55.1 => 0.55.1
Add the following to your dependecies inside android/app/build.gradle


    compileSdkVersion 26
    buildToolsVersion '26.0.2'
      targetSdkVersion 26
compile ("com.android.support:support-v4:26.0.1") {
        force = true //<-- force dependency resolution to 26.0.1 in my case
    }
Also make sure to update android/build.gradle to use gradle 3 and add google


// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}
Don't forget to also to update the distribuitionUrl in android/gradle/wrapper/gradle-wrapper.properties


distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

相關推薦

react-native-camera

安裝過程無法編譯, 按以下方法修正A mix of things worked for me.  react: 16.3.1 => 16.3.1  react-native: 0.55.1 => 0.55.1Add the following to your de

react-native整合+記錄

Gradle Compilecompile "com.facebook.react:react-native:+"許可權新增<uses-permission android:name="android.permission.INTERNET"/> <uses

react native 增加react-native-camera

err main 地址 技術 iss body lin yarn services 前提:已經正常運行的項目 第一步:使用命令加入react-native-camera,並且關聯react-native-camera, yarn add react-native

react-native-camera 掃描二維碼

Github:https://github.com/react-native-community/react-native-camera android: 1、npm install react-native-camera --save      

linux平臺安裝React Native遇到的

3年前我在windows平臺安裝過React Native,我一直都記憶猶新,那個時候facebook剛推出支援安卓,然後花了一天的時間在自己的window電腦上配置好了,還是很興奮的,安裝部落格地址如下 現在我的開發環境是ubuntu,所以需要在這個平臺安裝react

記錄VSCode開發React Native的一些

當我們點Debug Android時,會彈出以下錯誤  Could not debug. Unable to set up communication with VSCode react-native extension. Is this a react-native project,

React-native初學者入門集合

一、搭建環境坑 1.首先要安裝android studio這個環境 坑就在於要先下載好jdk,具體配置另一篇有些。就是環境的配置。 其次參考一下連結:[link] (https://www.cnblogs.com/xiadewang/p/7820377.html

react native 的 很多很多!自己已踩完

1. 從後臺傳回來的日期格式可能是這樣(2018-05-04 13:20:09),“-”這個可能轉換時這個時間就會變空。所以我們要這樣做:new Date(data.curriculaTime.replace(/-/g, "/"));—————————————————————

react dva】實錄,router 4.0+, less 【一直更新】

 · 坑1:路由升級react-dom到16.0.0後,相應的router 也被升級到了4.0以上。以往的路由設定失效。以往:<Route path='/HomeIndex' component={Home}> <IndexRoute comp

Android 真機搭建 React-Native 環境踩記錄

本文記錄了我搭建 React-Native 專案時踩過的坑(下稱 RN),以及使用 Android 真機執行 RN 專案遇到的問題,供大家參考。 初始化 RN 專案 執行 react-native init [your project name] 命令在本地初始化一個 RN 專案

react-native-viewpager踩

react-native-viewpager是一個輪播圖元件,最近有一個需求是有一個測試題頁面,我第一反應是用一個輪播圖元件,只是把輪播圖替換成輪播檢視,每個視圖裡面內容比圖片複雜一些而已。。。然而,我只是這麼想想,實際做起來還不知道會遇到什麼坑,開始踩坑

react-native 踩到之 transform skewX skewY

提示,本文不能解決問題,但作為一個坑的記錄,經驗教訓。 rn版本 0.46 眾所周知,transform是用來變換檢視的屬性, 經實踐,transform各個屬性在ios平臺上執行良好,安卓上的表現與ios不一致。 比較嚴重的是在安卓上skewX、skewY比較扯蛋,sk

Android studio for Mac配置React-native時的

最近自己配了一下React native環境,各種坑。以下兩個給我留下了深刻的印象,其實都是這樣一種心情:解決不了超級蛋疼,解決完了覺得自己一定遇到了一個假問題!不多說,請看大螢幕: 1、ndk-build binary cannot be found, check if

攝像機檢視 react-native-camera 手機開發工具

https://github.com/lwansbrough/react-native-camera react-native-camera 是 React Native 的攝像頭 viewport。這個模組應用於開發的早期階段,它支援攝像頭的轉換和基本圖片捕捉。 使

React-Native 遇到的

一、錯誤日誌:Warning: Failed child context type: Invalid child context virtualizedCell.cellKey of type nu

react-native開發踩之 ios上react-native-vector-icons 的error:unRecognized font family 'FontAwesome'

RN開發過程中使用了第三方圖示庫,由於對iOS也不是特別熟,所以搞了兩天才跨過去,解決完畢後分享一下,畢竟RN開發資源還是比較稀缺的,多一點貢獻是一點。 解決問題首先第一步那絕對是官網找,react-native-vector-icons github連結地址

React Native 二維碼掃描 react-native-camera的使用

npm install [email protected]://github.com/lwansbrough/react-native-camera.git --savereact-native link react-native-camera import

react native新手踩-遇到warning的相關解決辦法

出現Warning:Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer',expected

react-native遇到的,及解決方法

2. 新增tabBar 時新增 selected = { this.state.selectedTab === 'FaceMash' }  這句話 ,會報 null not an object(evaluating this.state.selectedTab)  提示

react-native整合react-native-camera 異常

* What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'. > Could not resolve all task dependencies for configuration ':