2017-08-31 3 views
1

hinzufügen Ich erstelle eine Beispiel-App in Ionic. Ich erhalte eine cordova Plugin, um meine app von lokalen Ordnern unter Fehlern auf Hinzufügen:Konnte kein Cordova-Plugin aus dem lokalen Ordner

cordova plugin add ../local-cordova-plugin --save
✖ Running command - failed!
[ERROR] An error occurred while running cordova plugin add ../local-cordova-plugin --save (exit code 1):
Error: Failed to get absolute path to installed module

Hinweis: Dieser Fehler tritt auf, wenn ich es hinzufügen, nachdem ich Plugins von NPM-Repository oder das Hinzufügen von jeder Plattform zu meiner App hinzugefügt habe. Wenn ich es vor dem Hinzufügen eines anderen Plugins oder einer anderen Plattform hinzufüge, wird es erfolgreich hinzugefügt.

Schritte zum Reproduzieren:

$ ionic cordova plugin add ../local-cordova-plugin

Hinweis: die lokale cordova Plugin hinzufügen, nachdem eine Plattform oder ein Plugin von NPM-Repository Ihre ionischen App hinzufügen.

Weitere Informationen: Es gibt eine similar issue geschrieben, aber es hat mein Problem nicht beheben. Ich habe Flags wie --nofetch, --force, --noregistry, --searchpath verwendet, aber keine Hilfe.

Ionic Info:

`` ` cli Pakete: (/ usr/local/lib/node_modules)

@ionic/cli-utils : 1.9.2 
ionic (Ionic CLI) : 3.9.2 

globale Pakete:

Cordova CLI : 7.0.1 

lokale Pakete:

@ionic/app-scripts : 2.1.3 
Cordova Platforms : android 6.2.3 
Ionic Framework : ionic-angular 3.6.0 

System:

Android SDK Tools : 26.0.2 
Node    : v7.0.0 
npm    : 3.10.8 
OS    : macOS Sierra 

aktualisieren: plugin.xml meiner local-cordova-Plugin (wie von @MaximShoustin angefordert)

<?xml version='1.0' encoding='utf-8'?> 
<plugin id="com.local.cordova" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> 
    <name>local_plugin</name> 
    <js-module name="local_plugin" src="www/local_plugin.js"> 
    <clobbers target="local" /> 
    </js-module> 
    <platform name="android"> 
    <config-file parent="/*" target="res/xml/config.xml"> 
     <feature name="local_plugin"> 
     <param name="android-package" value="com.local.cordova.local_plugin" /> 
     </feature> 
    </config-file> 
     <config-file parent="/*" target="AndroidManifest.xml"> 
    </config-file> 
    <source-file src="src/android/local_plugin.java" target-dir="src/com/local/cordova/local_plugin" /> 
    <resource-file src="local-release/local-1.0.0-release.aar" target="libs/local-1.0.0-release.aar" /> 
    <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge"> 
     <uses-sdk android:minSdkVersion="19" /> 
    </edit-config> 
    </platform> 
</plugin> 
+0

Haben Sie versucht, es über Cordova hinzuzufügen? a.e: 'cordova plugin hinzufügen ../local-cordova-plugin --save' –

+0

Ja, ich habe es versucht, aber es wirft den gleichen Fehler. Vielen Dank. –

+0

Stellen Sie sicher, dass Sie berechtigt sind, diesen Pfad zu lesen. Auch post 'plugin.xml' von' local-cordova-plugin' –

Antwort

1

Nach viel Suchen und Surfen, bekam ich die Lösung für mein Problem. Ich habe in node_modules nachgesehen und es gibt eine Datei/Symlink des Plugins, das ich installieren wollte. Sobald ich das entfernte, hatte ich kein Problem, das Plugin zu installieren.

Verwandte Themen