ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.13k stars 1.56k forks source link

Build error on Android #596

Closed greenais closed 6 years ago

greenais commented 6 years ago

All post installation steps done (except optional video) React 16.0 RN 50.4, RNICP ^0.19.1 - latest from npm

==============

FAILURE: Build failed with an exception.

===============

Any suggestions, perhaps?

buglas commented 6 years ago

我也遇到了类似问题 "react": "16.2.0", "react-native": "0.52.2", "react-native-image-crop-picker": "^0.19.1"

报的错是:

ivpusic commented 6 years ago

follow readme file, there is section:

Add the following to your build.gradle's repositories section. (project build.gradle)
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
greenais commented 6 years ago

Was exactly done, you were too hurry to close an issue. No prob, will use another lib.

elKrionoah commented 6 years ago

something like that ????

    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "https://jitpack.io",
            url "$rootDir/../node_modules/react-native/android"
        }
    }

I have a similar problem

screen shot 2018-01-31 at 14 37 27

ivpusic commented 6 years ago

@krionoah69 I updated android section in readme. https://github.com/ivpusic/react-native-image-crop-picker#android. So basically android/build.gradle allProjects section should be:

allprojects {
    repositories {
      mavenLocal()
      jcenter()
      maven { url "$rootDir/../node_modules/react-native/android" }

      // jitpack repo is necessary to fetch ucrop dependency
      maven { url "https://jitpack.io" }
    }
}
elKrionoah commented 6 years ago

@ivpusic I made the changes but now there was a bigger problem. Add as it appears in the documentation (android / build.gradle):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
      mavenLocal()
      jcenter()
      maven { url "$rootDir/../node_modules/react-native/android" }

      // jitpack repo is necessary to fetch ucrop dependency
      maven { url "https://jitpack.io" }
    }
}

Add what refers to (android / app / build.gradle):

    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId "com.netbeepocket" // <-- This line.
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 2
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

And in the end I throw this error: screen shot 2018-02-01 at 13 45 33

I have searched several post about the problem but I do not give with the solution.