NativeScript / nativescript-imagepicker

Imagepicker plugin supporting both single and multiple selection.
Apache License 2.0
104 stars 74 forks source link

Conflicts with nativescript-telerik-ui-pro #50

Closed kwong93 closed 7 years ago

kwong93 commented 7 years ago

I have nativescript-imagepicker installed, version 2.4.1, and nativescript-telerik-ui-pro version 1.4.1. When I run it on android, gradle fails with this error:

:processF0F1F2F3F4F5F6DebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processF0F1F2F3F4F5F6DebugResources'.
> Error: more than one library with package name 'com.telerik.android.common'

It was working with 2.3.1 version of imagepicker.

I have nativescript 2.4 installed

Somebody else had similar problem I think: https://github.com/NativeScript/nativescript-cli/issues/2258

markfarl commented 7 years ago

I managed to get around this issue by deleting the

nativescriptproject\node_modules\nativescript-imagepicker\node_modules\nativescript-telerik-ui

folder and deleting reference to it in the

nativescriptproject\node_modules\nativescript-imagepicker\package.json

Inside dependencies: { } line 16/17

Although will still be issue again if you rebuild your project

tsonevn commented 7 years ago

I am attaching summarized steps with a workaround, which resolved this behavior.

  1. open node_modules and delete nativescript-telerik-ui folder.
  2. open node_modules/nativescript-imagepicker/package.json file. search for nativescript-telerik-ui and change the dependency name to nativescript-telerik-ui-pro 3.open node_modules/nativescript-imagepicker/images.ios.js file and replace var listview_1 = require("nativescript-telerik-ui/listview"); with var listview_1 = require("nativescript-telerik-ui-pro/listview");
  3. the last step is to remove platform with tns platform remove <platform_name>
  4. build with tns run <platform_name>

Keep in mind that if you remove node_modulesfolder you should make those changes again.

40x commented 7 years ago

Any update on this bug? Still need to use workaround?

RyanSMurphy commented 7 years ago

Please can you reopen this as there is no fix yet. Can you create a permanent fix for this please rather than having to follow those steps on each npm install?

tsonevn commented 7 years ago

Hi @RyanSMurphy, Thank you for writing us This issue is still opened and the problem with nativescript-telerik-ui-pro and nativescript-imagepicker in the same app should be resolved in the upcoming release 3.0.

RyanSMurphy commented 7 years ago

@tsonevn When will this be released? The app is working great on ios simulator, but the app crashes when on real device and im having trouble working it out because i cant get logs from actual ios device. any suggestions?

tsonevn commented 7 years ago

Hi @RyanSMurphy, The new version of NativeScript 3.0 is officially published in npm and you could upgrade the platform on your side. Regarding the release of UI for NativeScript. The new version of nativescript-telerik-ui-pro 2.0 will be available tomorrow.

RyanSMurphy commented 7 years ago

@tsonevn Are you sure v2 is being released? I can only find details on 1.7.

Also, I'm not sure how this will resolve the fact that this plugin is incompatible.

tsonevn commented 7 years ago

Hi @RyanSMurphy UI for NativeScript 2.0 was released today and you could find it in NPM here. Let me know if you have some further issues while using the new version.

nicolam1 commented 7 years ago

Any updates on this? We cannot use this plugin when using ui-pro

tsonevn commented 7 years ago

Hi @nicolam1, After migration nativescript-imagepicker plugin to 3.0 it is possible to use it in the same app with nativescript-telerik-ui-pro 2.0.1. For your convenience, I am attaching sample app, which you could test on your side. Bear in mind that I tested this scenario with NativeScript 3.0.

Archive.zip

nicolam1 commented 7 years ago

Thank you!

antkiewicz commented 7 years ago

@tsonevn Doesn't nativescript-telerik-ui-pro contain the same components as nativescript-telerik-ui package, plus few extra ones? Would it be possible to use UI Pro package when it is present instead of requiring to install UI just to use this image picker? That way unnecessary duplication of components could be avoided.

tsonevn commented 7 years ago

Hi @antkiewicz, Indeed nativescript-telerik-ui-pro contains all component from the free version, however, using the both plugins in the same app should work as expected. In case you still want to have only nativescript-telerik-ui-pro plugin as a dependency you could review this comment, where it is shown how to replace free version with the pro one in the image picker plugin

RyanSMurphy commented 7 years ago

This still doesn't work. You must find a way to either make them both work or add this information to your documenattion.

tsonevn commented 7 years ago

Hi @RyanSMurphy, Could you specify the error, which is thrown when you are using the both plugins in the same app? Also verify, that you are using the latest version of NativeScript and nativescript-imagepicker.

RyanSMurphy commented 7 years ago

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 13.147 secs Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.

Using latest nativescript version with "nativescript-imagepicker": "^3.0.2",

tsonevn commented 7 years ago

HI @RyanSMurphy , Which version of NativeScript do you use? You could verify this by running tns --version. Make sure that you are using 3.1.2.

RyanSMurphy commented 7 years ago

I am indeed using 3.1.2.

It works on iOS, but not on Android.

tsonevn commented 7 years ago

@RyanSMurphy, In case this issue is reproducible only on Android, verify whether you have installed Build-tools 25.0.2 in your Android SDK Manager. screen shot 2017-07-12 at 3 30 32 pm

RyanSMurphy commented 7 years ago

screen shot 2017-07-13 at 10 09 07

@tsonevn As you can see, I have up to 26 installed

tsonevn commented 7 years ago

Hi @RyanSMurphy, Could you select the Show Package Details checkbox and fo verify again specifically for Build-tools 25.0.2? screenshot 40

RyanSMurphy commented 7 years ago

So it didnt have that installed. I installed it, went straight back to my terminal, deleted android folder, re ran build, and it still failed.

RyanSMurphy commented 7 years ago

screen shot 2017-07-13 at 10 51 40

@tsonevn

RyanSMurphy commented 7 years ago

FYI these are my dependencies in package.json for them both at root:

"nativescript-telerik-ui": "^3.0.1",
"nativescript-telerik-ui-pro": "file:nativescript-ui-pro.tgz",
RyanSMurphy commented 7 years ago

When i remove nativescript-telerik-ui it also breaks on ios. Any updates on this?

RyanSMurphy commented 7 years ago

@tsonevn any updates on this?

EddyVerbruggen commented 7 years ago

Just proposed PR #104 to fix this nasty issue.