ivpusic / react-native-image-crop-picker

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

Android build fails on clean project #86

Closed sznrbrt closed 7 years ago

sznrbrt commented 7 years ago

Version

"react-native": "0.34.0",
"react-native-image-crop-picker": "^0.9.5"

Platform

Clean project produces this error on android: FAILURE: Build failed with an exception.

Steps to reproduce

  1. npm i react-native-image-crop-picker --save
  2. react-native link react-native-image-crop-picker
  3. react-native run-android

    Attachments

`FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 8.504 secs Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html`

apurv commented 7 years ago

@ivpusic I tried making an Android build yesterday (after you'd asked me to check about #83 on Android) and got this exact issue.

ivpusic commented 7 years ago

try to apply changes from https://github.com/ivpusic/react-native-image-crop-picker/commit/6d59b8408aec74ddcd50e9139879355ff517329b on your project.

ivpusic commented 7 years ago

@sznrbrt any updates here?

sznrbrt commented 7 years ago

@ivpusic Just had the time to check it quickly, but still having issues. Although Im not sure anymore its not on my side.

Build file '/Users/[username]/temp/CropTest/android/app/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
ivpusic commented 7 years ago

probably this time is something on your side.

nigelnindo commented 7 years ago

Faced the same issue. Making the recommended changes solved this issue for me.

falbertp commented 7 years ago

The same issue,

* Where:
Build file 'D:\Frank\workspace\ReactProject\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : U
nsupported major.minor version 52.0

try suggested on 6d59b84 but still the same error...

Please help

ricardomonagas commented 7 years ago

Currently, facing this problem and I implemented the changes recommended above but no solution yet.

pedrobertao commented 7 years ago

My solution to the problem was ( using Windows):

Set ANDROID_HOME variable Path (Obviously) Check my Java for Updates and update Change the JAVA_HOME variable Path

aprilmintacpineda commented 7 years ago

Using: windows 10

I am experiencing the same error on a fresh install of react-native.

react-native init AwesomeProject
cd AwesomeProject
react-native run-android // at this point, I have android emulator from android studio up and running

The output I got was:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\aprilpineda\Documents\projects\mobile\AwesomeProject\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 24.768 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

I already have a set

ANDROID_HOME =C:\Users\aprilpineda\AppData\Local\Android\sdk
JAVA_HOME = C:\Program Files (x86)\Java\jre1.8.0_141

my Package.json is as follows:

Note that this is a fresh install
{
    "name": "AwesomeProject",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "react": "16.0.0-alpha.12",
        "react-native": "0.48.4"
    },
    "devDependencies": {
        "babel-jest": "21.0.2",
        "babel-preset-react-native": "4.0.0",
        "jest": "21.1.0",
        "react-test-renderer": "16.0.0-alpha.12"
    },
    "jest": {
        "preset": "react-native"
    }
}

I also have applied this -> https://github.com/ivpusic/react-native-image-crop-picker/commit/6d59b8408aec74ddcd50e9139879355ff517329b

aprilmintacpineda commented 7 years ago

I fixed it by downloading JDK 1.8.0. Then I used that instead of JRE.

jackYouth commented 6 years ago

Build file 'D:\Frank\workspace\ReactProject\android\app\build.gradle' line: 1 这个问题,更新到1.8之后,把系统变量JAVA_HOME 的地址指向本地安装的jdk1.8对应目录就行了