bthurlow / nativescript-imagecropper

A nativescript image cropping plugin.
Other
49 stars 35 forks source link

Fix multidex on Android #31

Closed odnamrataizem closed 6 years ago

odnamrataizem commented 6 years ago

This should fix #30.

The script is currently setting every package inside com.android.support to the SDK version number. Some of them, like the Multidex ones, are on a different version number, but #28 only partially addressed this: there are more Multidex packages whose version numbers differ from the SDK one, e.g. multidex-instrumentation, so I made a slight change to the way the script looks for them.

shiv19 commented 6 years ago

We'll go with PR #32

shiv19 commented 6 years ago

Published as v1.0.2

sorry for the delay

bzaruk commented 6 years ago

@DickSmith @shiv19 -

Seems like it fails to build (debug and release).

this is the error I get:

Failed to build plugin nativescript-imagecropper :
Error: Command ./gradlew failed with exit code 1 Error output:
 /Users/barzaruk/.gradle/caches/transforms-1/files-1.1/ucrop-2.2.2-native.aar/9312cacab428f9dff2bb0863d4104a9f/res/values/values.xml:72:5-77:13: AAPT: resource attr/selectableItemBackground (aka org.nativescript.nativescript_imagecropper:attr/selectableItemBackground) not found.

/Users/barzaruk/Documents/Projects/staccato_lean_client/platforms/tempPlugin/nativescript_imagecropper/build/intermediates/res/merged/release/values/values.xml:75: AAPT: resource attr/selectableItemBackgroundBorderless (aka org.nativescript.nativescript_imagecropper:attr/selectableItemBackgroundBorderless) not found.

/Users/barzaruk/Documents/Projects/staccato_lean_client/platforms/tempPlugin/nativescript_imagecropper/build/intermediates/res/merged/release/values/values.xml:69: error: resource attr/selectableItemBackground (aka org.nativescript.nativescript_imagecropper:attr/selectableItemBackground) not found.
/Users/barzaruk/Documents/Projects/staccato_lean_client/platforms/tempPlugin/nativescript_imagecropper/build/intermediates/res/merged/release/values/values.xml:75: error: resource attr/selectableItemBackgroundBorderless (aka org.nativescript.nativescript_imagecropper:attr/selectableItemBackgroundBorderless) not found.
error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

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

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
DickSmith commented 6 years ago

@shabib3 Yeah, that's been the trouble with these, there doesn't seem to be a way to make the setup compatible for both 3.x and 4.x. Either 4.x works and 3.x has conflicts; or 3.x works and 4.x is missing dependencies.

Based on your error, I'm guessing you're on {N} 4.x.

In speaking with @shiv19 , the easiest solution may be to let the current package be the last 3.x-compatible, and then push a new build that is compatible with 4.x-only.

Trying to get this to work for both results in having to do very convoluted stuff, which then led to the multidex issues, and potentially many others too.

For now locally you can change it to:

dependencies {
  implementation 'com.github.yalantis:ucrop:2.2.2-native'
}
bzaruk commented 6 years ago

@DickSmith

Ok so I'll try to add this to app.gradleand see if it works. Let me know if there is any update about the issue solution :)

bzaruk commented 6 years ago

@DickSmith -

Adding implementation 'com.github.yalantis:ucrop:2.2.2-native' to my app.gradle didn't do any change...

DickSmith commented 6 years ago

@shabib3 Sorry, what I meant was to edit the node_module file directly and see if that works.