美文网首页
ReactNative 本地编译

ReactNative 本地编译

作者: OK2018 | 来源:发表于2018-06-28 20:39 被阅读0次

    工程build.gradle文件

    buildscript {
        repositories {
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
            jcenter {
                url "http://jcenter.bintray.com/"
            }
            maven { url "https://jitpack.io" }
    
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.3'
            classpath 'de.undercouch:gradle-download-task:3.4.3'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
            jcenter {
                url "http://jcenter.bintray.com/"
            }
            maven { url "https://jitpack.io" }
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
    
    
        }
    }
    

    没有

    classpath 'de.undercouch:gradle-download-task:3.4.3'
    

    则ReactAdnroid中的

    import de.undercouch.gradle.tasks.download.Download
    

    报错

     unable to resolve class de.undercouch.gradle.tasks.download.Download
    
     maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
    

    要在

     jcenter {
                url "http://jcenter.bintray.com/"
            }
    

    前面,否则报错

    Error:Failed to resolve: com.android.support:support-core-ui:27.1.1
    

    相关文章

      网友评论

          本文标题:ReactNative 本地编译

          本文链接:https://www.haomeiwen.com/subject/asvnyftx.html