Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

Class Not Found #56

Open
Open

Description

@mario-aleo

I've been trying to use Canvas2Plugin and i finally got cordova.exec working with it, but, when it's called on android, it throws an error: Class Not Found.

The code is:

  var SaveImage = function(element, success, error){
      var canvas = document.getElementById(element);
      var imageDataUrl = canvas.toDataURL('image/jpeg', 1.0);
      var imageData = imageDataUrl.replace(/data:image\/png;base64,/,'');
      cordova.exec(success, error, 'Canvas2ImagePlugin', 'saveImageDataToLibrary', [imageData]);
      $scope.return = 'Saved';
  };

  var success = function(msg){
      $scope.return = msg;  
  };

  var error = function(err){
      $scope.return = err;
  };

  $scope.save = function(){
      SaveImage('pwCanvasMain', success, error);
  };

As you may see, I'm using angular.js.
Does anyone know whats is this error?
On IOS it isn't saving.

Thanks.

Activity

  1. archy-bold commented on Nov 5, 2015

    @archy-bold

    I had the same issue. The likelihood is you didn't compile the application after adding the plugin and just allowed the application to update with livereload.

    Recompiling the app should work.

  2. mario-aleo commented on Nov 5, 2015

    @mario-aleo
    Author

    Right, I'll give it a try.
    Thanks.

  3. mttm-xyz commented on Oct 23, 2019

    @mttm-xyz

    Hi,have you solved this problem ? I also have the same problem.@mario-aleo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions