sarriaroman / photoviewer

PhotoViewer Cordova Plugin
MIT License
157 stars 213 forks source link

Error while building on android. #154

Open sandy912 opened 5 years ago

sandy912 commented 5 years ago

Error log: BUILD FAILED in 3s 27 actionable tasks: 7 executed, 20 up-to-date /Users/sandy/work/deviceapi/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/sandy/Work/deviceapi/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:169: error: cannot find symbol private Piccasso setOptions(Piccasso picasso) throws JSONException { ^ symbol: class Piccasso location: class PhotoActivity /Users/sandy/Work/deviceapi/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:169: error: cannot find symbol private Piccasso setOptions(Piccasso picasso) throws JSONException { ^ symbol: class Piccasso location: class PhotoActivity /Users/sandy/Work/deviceapi/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:224: error: cannot find symbol Piccasso picasso = Picasso.with(PhotoActivity.this)

harshzalavadiya commented 5 years ago

Same happned to me use 1.1.18 as workaround ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18

sandy912 commented 5 years ago

Same happned to me use 1.1.18 as workaround ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18

Thank you. Working like charm. Is there any workaround for slide down, slide up to close image?

sarriaroman commented 5 years ago

You can now use the version 1.1.21. Must fix the issue.

niranjangowda commented 5 years ago

for me this @1.1.18 works fine. but @1.1.21 not working

willyguevara commented 5 years ago

Using version 1.1.18 Works for me with this dev env: @harshzalavadiya thank you.

Ionic:

   ionic (Ionic CLI)  : 4.8.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)

System:

   Android SDK Tools : 25.2.5 (/usr/local/opt/android-sdk)
   ios-deploy        : 1.9.2
   ios-sim           : 7.0.0
   NodeJS            : v6.9.5 (/usr/local/bin/node)
   npm               : 6.5.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000 
WillPoulson commented 5 years ago

Using version 1.1.18 didn't resolve the issue for me. Any other suggested fixes?

sam-higton commented 5 years ago

@WillPoulson Have you tried removing and reinstalling the plugin? Also, regenerating the platform directory could fix it too.

WillPoulson commented 5 years ago

@sam-higton Hi Sam, Yea I've tried both. It's building on a new virtual environment every build. Just trying version 1.2.0 now to see if it fixes anything?

WillPoulson commented 5 years ago

Version 1.2.0 still resulting in PhotoActivity.java:171: error: cannot find symbol.

Any help would be very appreciated. Thanks.

EricKit commented 5 years ago

@sam-higton Same here with line 171 179 and 224. Line 224 looks like it has two C's in Picasso.

slagumen commented 5 years ago

Hi, Any news on this issue ? i had encounter the same problem. Thanks

gaurav-chandra commented 5 years ago

+1 on 1.2.0

gaurav-chandra commented 5 years ago

sorry, +1 for not working on 1.2.0 version

slagumen commented 5 years ago

Same here, 1.2.0 not building on android.

moplin commented 5 years ago

Hi my friends, I am having (i guess) the same problem. Already tried with "1.1.18" and "^1.2.0" with no luck.

I am using: "cordova-android": "7.1.4", "cordova-ios": "4.5.5",

No problem on ios build.

harshzalavadiya commented 5 years ago

it's because plugin is not properly uninstalled.

follow this steps might solve the issue

  1. uninstall plugin by using ionic cordova plugin remove pluginname
  2. remove plugins folder
  3. remove platforms/android folder
  4. build now by ionic cordova build android
WillPoulson commented 5 years ago

@harshzalavadiya I've already tried the above. As stated in my earlier comment the build is running in a new environment each time.

harshzalavadiya commented 5 years ago

basically error states that it's not able to resolve library

try opening created platform in android studio and check if there's any play services mismatch with other plugins if any or maven mirror missing.

if not working then please create gist of log and then we can see

moplin commented 5 years ago

@harshzalavadiya Did what you said. Full uninstall and re build, it worked. Added

$ ionic cordova plugin add com-sarriaroman-photoviewer
$ npm install --save @ionic-native/photo-viewer

Build again, failed with the same error

harshzalavadiya commented 5 years ago

@moplin can you provide error log as a gist. and if you are using ionic4 then use @ionic-native/photo-viewer@beta if v3 then it's fine.

instead of ionic cordova plugin add com-sarriaroman-photoviewer try ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18

and don't forget to remove plugin and platform first.

moplin commented 5 years ago

@harshzalavadiya Thanks my friend it did work. As you recommended:

  1. uninstall plugin by using: ionic cordova plugin remove com-sarriaroman-photoviewer
  2. remove plugins folder, and node_modules
  3. remove platforms/android folder
  4. Do a: ionic cordova platform rm android
  5. Install: ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18
  6. Add android: ionic cordova platform add android
  7. run: npm install
  8. build. It worked.
harshzalavadiya commented 5 years ago

@moplin glad it worked :tada: ,

Basically there was no need of removing node_modules or plugins folder as when you uninstall plugin cordova takes care of cleaning it up completely but sometimes there are chance of conflict that will break build so removing plugin by cli and deleting platform should have done the trick :wink:

WillPoulson commented 5 years ago

Any updates on the situation for people who are using fresh build environments?

giacomocerquone commented 5 years ago

Same problem, same solution. Just to make people lives' easier, this is more than enough:

ionic cordova plugin remove com-sarriaroman-photoviewer
ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18
WillPoulson commented 5 years ago

Thank you, turns out it wasn't changing/removing the version in the package.json. Problem solved.

fabiante commented 5 years ago

This works for Ionic 4:

com-sarriaroman-photoviewer@1.1.18 @ionic-native/photo-viewer@beta

Ionic:

   ionic (Ionic CLI)             : 4.9.0
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 10 other plugins)

System:

   Android SDK Tools : 26.1.1
   NodeJS            : v10.13.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10
niuwenbo commented 5 years ago

@moplin same solutions but also has this issue.has anyone solutions

RELAXccc commented 5 years ago

@moplin same solutions but also has this issue.has anyone solutions

ionic cordova plugin remove com-sarriaroman-photoviewer
ionic cordova platform remove android
ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18

worked for me.

I should have the newest ionic 4 libs (did npm update today)

qobiljon commented 5 years ago

Same happned to me use 1.1.18 as workaround ionic cordova plugin add com-sarriaroman-photoviewer@1.1.18

You're the best !

thameurr commented 5 years ago

After install it i get the same error : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91