photoviewer icon indicating copy to clipboard operation
photoviewer copied to clipboard

Error while building on android.

Open sandy912 opened this issue 6 years ago • 30 comments

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)

sandy912 avatar Jan 10 '19 07:01 sandy912

Same happned to me use 1.1.18 as workaround ionic cordova plugin add [email protected]

harshzalavadiya avatar Jan 10 '19 07:01 harshzalavadiya

Same happned to me use 1.1.18 as workaround ionic cordova plugin add [email protected]

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

sandy912 avatar Jan 10 '19 08:01 sandy912

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

sarriaroman avatar Jan 10 '19 12:01 sarriaroman

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

niranjangowda avatar Jan 11 '19 05:01 niranjangowda

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 ([email protected])
   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 

willyguevara avatar Jan 18 '19 10:01 willyguevara

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

WillPoulson avatar Jan 18 '19 15:01 WillPoulson

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

sam-higton avatar Jan 18 '19 15:01 sam-higton

@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 avatar Jan 18 '19 15:01 WillPoulson

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

Any help would be very appreciated. Thanks.

WillPoulson avatar Jan 18 '19 16:01 WillPoulson

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

EricKit avatar Jan 19 '19 19:01 EricKit

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

slagumen avatar Jan 20 '19 17:01 slagumen

+1 on 1.2.0

gaurav-chandra avatar Jan 21 '19 11:01 gaurav-chandra

sorry, +1 for not working on 1.2.0 version

gaurav-chandra avatar Jan 21 '19 11:01 gaurav-chandra

Same here, 1.2.0 not building on android.

slagumen avatar Jan 21 '19 11:01 slagumen

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.

  • did tired removing and re adding the as platform android.
BUILD FAILED in 3s
cmd: Command failed with exit code 1 Error output:
D:\Projects\FurionProjects\mm-ionic\platforms\android\app\src\main\java\com\sarriaroman\PhotoViewer\PhotoActivity.java:171: e
rror: cannot find symbol
            picasso.fit();
                   ^
  symbol:   method fit()
  location: variable picasso of type Picasso
D:\Projects\FurionProjects\mm-ionic\platforms\android\app\src\main\java\com\sarriaroman\PhotoViewer\PhotoActivity.java:175: e
rror: cannot find symbol
            picasso.centerInside();
                   ^
  symbol:   method centerInside()
  location: variable picasso of type Picasso
D:\Projects\FurionProjects\mm-ionic\platforms\android\app\src\main\java\com\sarriaroman\PhotoViewer\PhotoActivity.java:179: e
rror: cannot find symbol
            picasso.centerCrop();
                   ^
  symbol:   method centerCrop()
  location: variable picasso of type Picasso
D:\Projects\FurionProjects\mm-ionic\platforms\android\app\src\main\java\com\sarriaroman\PhotoViewer\PhotoActivity.java:200: e
rror: cannot find symbol
                    .into(photo, new com.squareup.picasso.Callback() {
                    ^
  symbol:   method into(ImageView,<anonymous Callback>)
  location: class Picasso
D:\Projects\FurionProjects\mm-ionic\platforms\android\app\src\main\java\com\sarriaroman\PhotoViewer\PhotoActivity.java:224: e
rror: cannot find symbol
                    Piccasso picasso = Picasso.with(PhotoActivity.this)
                    ^
  symbol: class Piccasso

moplin avatar Jan 21 '19 12:01 moplin

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

harshzalavadiya avatar Jan 21 '19 13:01 harshzalavadiya

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

WillPoulson avatar Jan 21 '19 13:01 WillPoulson

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

harshzalavadiya avatar Jan 21 '19 14:01 harshzalavadiya

@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

moplin avatar Jan 21 '19 14:01 moplin

@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 [email protected]

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

harshzalavadiya avatar Jan 21 '19 14:01 harshzalavadiya

@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 [email protected]
  6. Add android: ionic cordova platform add android
  7. run: npm install
  8. build. It worked.

moplin avatar Jan 21 '19 20:01 moplin

@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:

harshzalavadiya avatar Jan 22 '19 05:01 harshzalavadiya

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

WillPoulson avatar Jan 24 '19 10:01 WillPoulson

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 [email protected]

giacomocerquone avatar Jan 25 '19 01:01 giacomocerquone

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

WillPoulson avatar Jan 25 '19 10:01 WillPoulson

This works for Ionic 4:

[email protected] @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 ([email protected])
   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

fabiante avatar Jan 28 '19 08:01 fabiante

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

niuwenbo avatar Feb 18 '19 10:02 niuwenbo

@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 [email protected]

worked for me.

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

RELAXccc avatar Feb 20 '19 15:02 RELAXccc

Same happned to me use 1.1.18 as workaround ionic cordova plugin add [email protected]

You're the best !

qobiljon avatar Feb 28 '19 02:02 qobiljon

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

thameurr avatar Jun 21 '19 10:06 thameurr