sarriaroman / photoviewer

PhotoViewer Cordova Plugin
MIT License
157 stars 216 forks source link

Unable to build on Android - package com.squareup.picasso does not exist #200

Open yliu138 opened 4 years ago

yliu138 commented 4 years ago

I am using the ionic 4 with Cordova framework.

When I try to build on Android ionic cordova build android, it always return me with the following issue, seems that gradle is not able to source the picasso packages. I am using gradle, and even in Android studio I cannot make it work.

The error while building:

Task :app:compileDebugJavaWithJavac FAILED
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:22: error: package com.squareup.picasso does not exist
import com.squareup.picasso.Callback;
                           ^
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:23: error: package com.squareup.picasso does not exist
import com.squareup.picasso.Picasso;
                           ^
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:24: error: package com.squareup.picasso does not exist
import com.squareup.picasso.RequestCreator;
                           ^
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:34: error: package uk.co.senab.photoview does not exist
import uk.co.senab.photoview.PhotoViewAttacher;
                            ^
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:37: error: cannot find symbol
    private PhotoViewAttacher mAttacher;
            ^
  symbol:   class PhotoViewAttacher
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:177: error: cannot find symbol
    private RequestCreator setOptions(RequestCreator picasso) throws JSONException {
                                      ^
  symbol:   class RequestCreator
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:177: error: cannot find symbol
    private RequestCreator setOptions(RequestCreator picasso) throws JSONException {
            ^
  symbol:   class RequestCreator
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:151: error: cannot find symbol
        mAttacher = new PhotoViewAttacher(photo);
                        ^
  symbol:   class PhotoViewAttacher
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:198: error: cannot find symbol
            this.setOptions(Picasso.get().load(mImage)).into(photo, new Callback() {
                                                                        ^
  symbol:   class Callback
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:198: error: cannot find symbol
            this.setOptions(Picasso.get().load(mImage)).into(photo, new Callback() {
                            ^
  symbol:   variable Picasso
  location: class PhotoActivity
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:225: error: cannot find symbol
                                .into(photo, new Callback() {
                                                 ^
  symbol: class Callback
/Users/yangliu/dev/qin-app-all/4.0.0/qin/platforms/android/app/src/main/java/com/sarriaroman/PhotoViewer/PhotoActivity.java:224: error: cannot find symbol
                       setOptions(Picasso.get().load(mTempImage))

Here is my cordova environment:

Ionic:

   Ionic CLI                     : 6.9.3 (/Users/yangliu/.nvm/versions/node/v12.16.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 1.5.2
   @capacitor/core : 1.5.2

Cordova:

   Cordova CLI       : 8.1.0
   Cordova Platforms : android 8.1.0, browser 5.0.4, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-webview 4.2.1, (and 30 other plugins)

Utility:

   cordova-res (update available: 0.15.1) : 0.11.0
   native-run (update available: 1.0.0)   : 0.3.0

System:

   Android SDK Tools : 26.1.1 (/Users/yangliu/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v12.16.1 (/Users/yangliu/.nvm/versions/node/v12.16.1/bin/node)
   npm               : 6.14.5
   OS                : macOS Catalina
   Xcode             : Xcode 11.5 Build version 11E608c

Thanks in advance