Plugin_not_installed


#1

When i try to upload a photo from library i able to select a photo from library…but when it time to upload it shows a run time error

plugin_not_installed

here my code

 this.camera.getPicture(options).then((imagePath)=>{     
//toast controller  
   this.loading = this.loadingctrl.create({    
    content:'Please Wait..', 
    });  
   this.loading.present();   
   if(this.platform.is('android') && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY){
       this.filePath.resolveNativePath(imagePath)       
         .then(filePath => {         
            let correctPath = filePath.substr(0, filePath.lastIndexOf('/') + 1);     
             let currentName = imagePath.substring(imagePath.lastIndexOf('/') + 1,  imagePath.lastIndexOf('?'));      
              is.copyFileToLocalDir(correctPath, currentName, this.createFileName());    
    });    
 } else {    
   var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1);    
   var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1); 
     this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
     }  
  },(error)=>{  
    this.loading.dismiss();  
    this.presentToast('Error while Selecting Image..!'); 
  });
 }

Anyhelp Thanks..:)

#2

So line #1 works.

What code using a Cordova plugin would be executed then? (I don’t really know as your code doesn’t explain itself) That plugin seems to be missing.


#3

yeah line 1 works all fine …but when i select a picture and tap on okay to upload it shows this error…

camera ,File Plugin

for this work


#4

Post your ionic cordova plugin list output please.


#5

cordova-plugin-add-swift-support 1.6.0 "AddSwiftSupport"
cordova-plugin-battery-status 1.2.4 "Battery"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-contacts 2.3.1 "Contacts"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-media-capture 1.4.3 "Capture"
cordova-plugin-nativestorage 2.2.2 "NativeStorage"
cordova-plugin-photo-library 2.0.4 "Photo Library"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-x-toast 2.6.0 "Toast"
ionic-plugin-keyboard 2.2.1 “Keyboard”


#6

Please find out exactly which line is throwing that error and make sure the Ionic Native plugin and Cordova plugin behind it are installed.


#7

okay i’ll try to find…:slight_smile:


#8

Hi Madhi!
Have you found the solution?
I’m stuck w/ similar problem!

Ty


#9

which part you facing this problem…whether uploading from library or taking pictures from camera?


#10

Hi!

I got the problem in iOS env.

Either picking from library or taking pictures from the camera seems to work, at least in UI…

After taking picture or picking from library I get “plugin_not_installed”. I think the problem might be related to “cordova-plugin-file” or maybe “cordova-plugin-filepath” (which is android only).

Anyway I didn’t see “cordova-plugin-filepath” in your plugin list.

Here is mine.

cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-contacts 2.3.1 "Contacts"
cordova-plugin-crop 0.3.1 "CropPlugin"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-google-analytics 1.8.2 "Google Universal Analytics Plugin"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-safariviewcontroller 1.4.7 "SafariViewController"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 1.10.4 “PushPlugin”


#11

show your code…there is a problem in code


#12

Well, basically it is the same code as yours’
What was wrong in your code?


#13

My code had error in Copyfiledirectory function i’ll paste my code here to solve your problem

selecting image from gallery code is below

  this.platform.ready().then(success=>{             
     let options = {       
            quality: 50,   
            destinationType: this.camera.DestinationType.DATA_URL,     
            sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,               
      };         
       this.camera.getPicture(options).then((data)=>{      
            let loader= this.loadingctrl.create({  
                  content: "Please Wait..Image is loading",
                  });        
                 loader.present(); 
                    this.uploadedImage = "data:image/jpeg;base64," + data;
                     loader.dismiss(); 
            },(error)=>{      
              alert("Failed to Load image.. :(")  
              });  
          },(error)=>{  
                 alert("Sorry doesnt enter into the plugin");    
          });      
    }

to take pictures from camera code is below

this.platform.ready().then(success=>{            
       var options = { 
                     quality:50,    
                    destinationType: this.camera.DestinationType.DATA_URL,    
                    encodingType: this.camera.EncodingType.JPEG, 
                     mediaType:this.camera.MediaType.PICTURE,         
       };
              this.camera.getPicture(options).then((imageData)  =>{    
                 let load = this.loadingctrl.create({   
                      content: 'Please wait..While Image is loading',
                     });          
              load.present();               
             this.uploadedImage = 'data:image/jpeg;base64,' + imageData;   
              load.dismiss();   
            }, (error)=>{    
                      alert("Error Occured");     
              });    
            });

#14

Ty Madhi…

So in order to do not rely on Copy Stuff, you do tried to get inline data from DestinationType.DATA_URL, I presume…

I think i still need DestinationType.FILE_URI in my case… :frowning:

Do you have any clue @Sujan12 ? bout a working snippet, for camera DestinationType.FILE_URI in Ionic3 iOS?

I’m still getting plugin_not_installed…

Ty!


#15

Well, nevermind.

I skipped copy phase somehow. Now everything started to work.

Ty


#16

Do you have any idea of how I could do it with videos?