Plugin nicht gefunden oder ist nicht eine CDVPlugin. Überprüfen Sie Ihre plugin-mapping in config.xml

Ich habe erklärt meine plugin-Datei für iOS-innen plugin.xml etwa so:

  <config-file target="config.xml" parent="/*">
      <feature name="CDVOP">
          <param name="ios-package" value="CDVOP"/>
      </feature>
  </config-file>

  <header-file src="src/ios/CDVOP.h" />
  <source-file src="src/ios/CDVOP.m" />

In der plugin-JavaScript-Datei habe ich diese Funktion, die ich später Anruf von der JavaScript-app

showCatPictures: function(interval) {
  exec(null, null, 'CDVOP', 'showCatPictures', [interval]);   
},

Mir läuft die app, verwendet das plugin von xcode zu sehen, die debug-Ausgabe. Ich bekomme diese, wenn ich rufen Sie die showCatPictures Funktion:

OP Cordova Tests[1122:60b] ERROR: Plugin 'CDVOP' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-02-14 16:23:45.233 OP Cordova Tests[1122:60b] -[CDVCommandQueue executePending] [Line 127] FAILED pluginJSON = [
  "INVALID",
  "CDVOP",
  "showCatPictures",
  [
    30
  ]
]

Ich vermute, dass dies kann haben etwas zu tun mit den Sachen, die ich importiert, so ist hier CDVOP.h

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDV.h>
#import <Cordova/CDVViewController.h>

//OP SDK
#import "OpenpeerSDK/HOPStack.h"
#import "OpenpeerSDK/HOPLogger.h"
#import "OpenpeerSDK/HOPMediaEngine.h"
#import "OpenpeerSDK/HOPCache.h"
#import "OpenpeerSDK/HOPAccount.h"
#import "OpenpeerSDK/HOPIdentity.h"

@interface CDVOP : CDVPlugin <UIWebViewDelegate> {
    NSString* callbackId;
    UIImageView* peerImageView;
    UIImageView* selfImageView;
}

@property (nonatomic, copy) NSString* callbackId;
@property (retain, nonatomic) UIImageView *peerImageView;
@property (retain, nonatomic) UIImageView *selfImageView;

- (void) authorizeApp:(CDVInvokedUrlCommand*)command;
- (void) configureApp:(CDVInvokedUrlCommand*)command;
- (void) getAccountState:(CDVInvokedUrlCommand*)command;
- (void) startLoginProcess:(CDVInvokedUrlCommand*)command;
- (void) showCatPictures:(CDVInvokedUrlCommand*)command

@end

- und dies ist der Obere Teil der CDVOP.m:

#import "CDVOP.h"

@implementation CDVOP

@synthesize webView, selfImageView, peerImageView, callbackId;

-(CDVPlugin*) initWithWebView:(UIWebView*)theWebView
{
    self = (CDVOP*)[super initWithWebView:theWebView];
    NSLog(@">>> initializing with cordova webView <<<"); //actually this does not get called!
    return self;
}

//stress test UIImageViews using a series of cat pictures
- (void)showCatPictures:(CDVInvokedUrlCommand*)command
{   
    //initialize and configure the image view
    CGRect selfRect = CGRectMake(0, 0, 100.0, 200.0);
    self.selfImageView = [[UIImageView alloc] initWithFrame:selfRect];
    [self.webView.superview addSubview:self.selfImageView];

    //load pictures and start animating
    NSLog(@"displaying cat pictures");
    selfImageView.animationImages = [NSArray arrayWithObjects:
      [UIImage imageNamed:@"1.JPG"], [UIImage imageNamed:@"2.JPG"], [UIImage imageNamed:@"3.JPG"],
      [UIImage imageNamed:@"4.JPG"], [UIImage imageNamed:@"5.JPG"], [UIImage imageNamed:@"6.JPG"],
      [UIImage imageNamed:@"7.JPG"], [UIImage imageNamed:@"8.JPG"], nil];

    selfImageView.animationDuration = 0.3;
    [selfImageView startAnimating];
}

Irgendwelche Ideen, warum das plugin scheint nicht richtig initialisiert und warum kann ich die Methoden aufrufen mit exec?

InformationsquelleAutor Aras | 2014-02-15
Schreibe einen Kommentar