0

私はubuntuでイオン(1.7.15)を使用しています。ngCordovaカレンダープラグインを追加しようとして、Ionic Build Androidコマンドが例外で失敗する

calendarプラグインを実装しようとするまで、私のプロジェクトはうまく動作します。このプラグインをプロジェクトにインストールした後、ionic build androidコマンドでビルドしようとしましたが、次のエラーが表示されます。

UNEXPECTED TOP-LEVEL EXCEPTION: 
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl; 

enter image description here

は、私は私のプロジェクトで複数のプラグインに何らかの解決策があるため、上記のエラーが発生願っています。このエラーはから hereに関連しています。私が試してみました何

:私は私のアップグレードアンドロイドSDKを試してみました

このスタックオーバーフローの質問Could not resolve all dependencies for configuration ':_armv7DebugCompile'を使用すると、上記のエラーが表示されます。

はここにここに私のfetch.jsonファイル

{ 
    "cordova-plugin-device": { 
     "source": { 
      "type": "registry", 
      "id": "[email protected]~1.1.1" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-console": { 
     "source": { 
      "type": "registry", 
      "id": "[email protected]~1.0.2" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-whitelist": { 
     "source": { 
      "type": "registry", 
      "id": "cordova-plugin-whitelist" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-splashscreen": { 
     "source": { 
      "type": "registry", 
      "id": "cordova-plugin-splashscreen" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-statusbar": { 
     "source": { 
      "type": "registry", 
      "id": "[email protected]~2.1.0" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "ionic-plugin-keyboard": { 
     "source": { 
      "type": "registry", 
      "id": "ionic-plugin-keyboard" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-camera": { 
     "source": { 
      "type": "registry", 
      "id": "cordova-plugin-camera" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "phonegap-plugin-push": { 
     "source": { 
      "type": "registry", 
      "id": "phonegap-plugin-push" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "com.phonegap.plugins.PushPlugin": { 
     "source": { 
      "type": "git", 
      "url": "https://github.com/phonegap-build/PushPlugin.git", 
      "subdir": "." 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-datepicker": { 
     "source": { 
      "type": "git", 
      "url": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git", 
      "subdir": "." 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-calendar": { 
     "source": { 
      "type": "registry", 
      "id": "cordova-plugin-calendar" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    }, 
    "cordova-plugin-crosswalk-webview": { 
     "source": { 
      "type": "registry", 
      "id": "cordova-plugin-crosswalk-webview" 
     }, 
     "is_top_level": true, 
     "variables": {} 
    } 
} 

である私は誰も私を助けてください何が悪かったのかについては考えている私のpackage.jsonファイル

{ 
    "name": "app", 
    "version": "1.1.1", 
    "description": "app: An Ionic project", 
    "dependencies": { 
    "gulp": "^3.5.6", 
    "gulp-sass": "^2.0.4", 
    "gulp-concat": "^2.2.0", 
    "gulp-minify-css": "^0.3.0", 
    "gulp-rename": "^1.2.0" 
    }, 
    "devDependencies": { 
    "bower": "^1.3.3", 
    "gulp-util": "^2.2.14", 
    "shelljs": "^0.3.0" 
    }, 
    "cordovaPlugins": [ 
    "cordova-plugin-device", 
    "cordova-plugin-console", 
    "cordova-plugin-whitelist", 
    "cordova-plugin-splashscreen", 
    "cordova-plugin-statusbar", 
    "ionic-plugin-keyboard", 
    { 
     "locator": "https://github.com/rossmartin/PushPlugin.git", 
     "id": "com.phonegap.plugins.PushPlugin" 
    } 
    ], 
    "cordovaPlatforms": [ 
    "android" 
    ] 
} 

です。

+0

私は@ EmptyCupは正しい:あなたはJARとしてAndroid Support Libraryを含むプラグインを持っていなければならず、このカレンダープラグイン[それをGradle依存として含む](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/blob/ master/plugin.xml#L76)。あなたが使用しているすべてのプラグインのリストを投稿したり、ちょうどあなたの 'config.xml'を投稿した方が助けになるでしょう – DaveAlden

+0

@DaveAlden config.xmlで私の質問を更新しました –

+0

申し訳ありませんが、 'ionic plugin add'を使用している場合や' plugins/fetch.json'を投稿している場合は 'package.json'です。 – DaveAlden

答えて

1

あなたの問題は、古いバージョンのプッシュプラグインを使用していることです。 package.jsonから、https://github.com/rossmartin/PushPlugin.gitが含まれています。これは、2年間で更新されていない非推奨のプラグインの維持されていないブランチです。

<source-file src="src/android/com/plugin/android-support-v13.jar" target-dir="libs/" /> 

あなたはプラグインのこのバージョンを削除し、up-to-date equivalentcordova-plugin-pushと交換し、どのuses Gradle to include the support libraryする必要があります:あなたはそのplugin.xmlを見ればそのため、あなたはプロセスを構築し、従来のAnt-駆動コルドバためincludes the Android Support Library as a JARそれを見ることができます:

<framework src="com.android.support:support-v13:23+" /> 

を使用すると、AndroidのAPIのV23のために構築する必要がありますので、SDKマネージャを経由して、これがインストールされている必要があり、コルドバのAndroidプラットフォーム([email protected]+)のV5の+を使用することに注意してください。

UPDATEはbuild.gradleファイルで

私はこの行を追加します。

この行を追加してくださいcom.android.support:multidex:1.0をコンパイルしてください。1'

dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    // SUB-PROJECT DEPENDENCIES START 
    debugCompile project(path: "CordovaLib", configuration: "debug") 
    releaseCompile project(path: "CordovaLib", configuration: "release") 
    compile "com.android.support:support-v4:+" 
    // SUB-PROJECT DEPENDENCIES END 
    compile 'com.android.support:multidex:1.0.1' 

} 

デフォルトの設定iがこのwebsite reffer彼のエラーを持って、私はプラットフォーム/アンドロイド/ LIBSを除去することによって、それを解決し、この行を追加した後、真

defaultConfig { 
     versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0") 
     applicationId privateHelpers.extractStringFromManifest("package") 

     if (cdvMinSdkVersion != null) { 
      minSdkVersion cdvMinSdkVersion 

     } 
     multiDexEnabled true 
    } 

をmultiDexEnabledこの行を追加します。/「android-support-v13.jar」このファイルを削除してください

プロジェクトのためにインストールされたすべてのプラグインはplugin.xmlファイルを探して、そのアンドロイドサポート-v13.jarを参照して上記のようにコメントしてください。ありがとうございました

+0

http://ngcordova.com/docs/plugins/pushNotifications/このウェブサイトをチェックしてください私はこのプラグインを使用してプッシュ通知をインストールします –

+0

私はイオンプラグインをダウンロードしておらず、プロジェクトに追加しました。私のcmdを使用してhttp://ngcordova.com/docs/plugins/で提供されているすべてのコードバプラグインをインストールしました –

+0

'私のconfig.xmlファイルで 'をビルドしようとしましたが、まだ同じエラーが発生しています –

関連する問題