Android Studio Cordova Push 플러그인

Jacobs

누군가 나를 도울 수 있습니까? 저는 Android 스튜디오를 처음 사용합니다.

프로젝트에 플러그인 푸시를 설치 한 후 다음 오류 메시지를 받았습니다.

오류 : ': dexDebug'작업에 대한 실행이 실패했습니다.

com.android.ide.common.process.ProcessException : org.gradle.process.internal.ExecException : Process 'command'/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/bin/java ''완료 0이 아닌 종료 값 2

Cordova https://github.com/phonegap-build/PushPlugin 과 함께 Android 스튜디오 1.3.2를 사용 합니다.

며칠을 찾고 있었지만 해결책을 찾을 수 없습니다

이 파일을 의미하길 바랍니다

    Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
*/

import java.util.regex.Pattern
import groovy.swing.SwingBuilder

String doEnsureValueExists(filePath, props, key) {
    if (props.get(key) == null) {
        throw new GradleException(filePath + ': Missing key required "' + key + '"')
    }
    return props.get(key)
}

String doGetProjectTarget() {
    def props = new Properties()
    file('project.properties').withReader { reader ->
        props.load(reader)
    }
    return doEnsureValueExists('project.properties', props, 'target')
}

String[] getAvailableBuildTools() {
    def buildToolsDir = new File(getAndroidSdkDir(), "build-tools")
    buildToolsDir.list()
        .findAll { it ==~ /[0-9.]+/ }
        .sort { a, b -> compareVersions(b, a) }
}

String doFindLatestInstalledBuildTools(String minBuildToolsVersion) {
    def availableBuildToolsVersions
    try {
        availableBuildToolsVersions = getAvailableBuildTools()
    } catch (e) {
        println "An exception occurred while trying to find the Android build tools."
        throw e
    }
    if (availableBuildToolsVersions.length > 0) {
        def highestBuildToolsVersion = availableBuildToolsVersions[0]
        if (compareVersions(highestBuildToolsVersion, minBuildToolsVersion) < 0) {
            throw new RuntimeException(
                "No usable Android build tools found. Highest installed version is " +
                highestBuildToolsVersion + "; minimum version required is " +
                minBuildToolsVersion + ".")
        }
        highestBuildToolsVersion
    } else {
        throw new RuntimeException(
            "No installed build tools found. Please install the Android build tools version " +
            minBuildToolsVersion + " or higher.")
    }
}

// Return the first non-zero result of subtracting version list elements
// pairwise. If they are all identical, return the difference in length of
// the two lists.
int compareVersionList(Collection aParts, Collection bParts) {
    def pairs = ([aParts, bParts]).transpose()
    pairs.findResult(aParts.size()-bParts.size()) {it[0] - it[1] != 0 ? it[0] - it[1] : null}
}

// Compare two version strings, such as "19.0.0" and "18.1.1.0". If all matched
// elements are identical, the longer version is the largest by this method.
// Examples:
//   "19.0.0" > "19"
//   "19.0.1" > "19.0.0"
//   "19.1.0" > "19.0.1"
//   "19" > "18.999.999"
int compareVersions(String a, String b) {
    def aParts = a.tokenize('.').collect {it.toInteger()}
    def bParts = b.tokenize('.').collect {it.toInteger()}
    compareVersionList(aParts, bParts)
}

String getAndroidSdkDir() {
    def rootDir = project.rootDir
    def androidSdkDir = null
    String envVar = System.getenv("ANDROID_HOME")
    def localProperties = new File(rootDir, 'local.properties')
    String systemProperty = System.getProperty("android.home")
    if (envVar != null) {
        androidSdkDir = envVar
    } else if (localProperties.exists()) {
        Properties properties = new Properties()
        localProperties.withInputStream { instr ->
            properties.load(instr)
        }
        def sdkDirProp = properties.getProperty('sdk.dir')
        if (sdkDirProp != null) {
            androidSdkDir = sdkDirProp
        } else {
            sdkDirProp = properties.getProperty('android.dir')
            if (sdkDirProp != null) {
                androidSdkDir = (new File(rootDir, sdkDirProp)).getAbsolutePath()
            }
        }
    }
    if (androidSdkDir == null && systemProperty != null) {
        androidSdkDir = systemProperty
    }
    if (androidSdkDir == null) {
        throw new RuntimeException(
            "Unable to determine Android SDK directory.")
    }
    androidSdkDir
}

def doExtractIntFromManifest(name) {
    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
    def pattern = Pattern.compile(name + "=\"(\\d+)\"")
    def matcher = pattern.matcher(manifestFile.getText())
    matcher.find()
    return Integer.parseInt(matcher.group(1))
}

def doPromptForPassword(msg) {
    if (System.console() == null) {
        def ret = null
        new SwingBuilder().edt {
            dialog(modal: true, title: 'Enter password', alwaysOnTop: true, resizable: false, locationRelativeTo: null, pack: true, show: true) {
                vbox {
                    label(text: msg)
                    def input = passwordField()
                    button(defaultButton: true, text: 'OK', actionPerformed: {
                        ret = input.password;
                        dispose();
                    })
                }
            }
        }
        if (!ret) {
            throw new GradleException('User canceled build')
        }
        return new String(ret)
    } else {
        return System.console().readPassword('\n' + msg);
    }
}

def doGetConfigXml() {
    def xml = file("res/xml/config.xml").getText()
    // Disable namespace awareness since Cordova doesn't use them properly
    return new XmlParser(false, false).parseText(xml)
}

def doGetConfigPreference(name, defaultValue) {
    name = name.toLowerCase()
    def root = doGetConfigXml()

    def ret = defaultValue
    root.preference.each { it ->
        def attrName = it.attribute("name")
        if (attrName && attrName.toLowerCase() == name) {
            ret = it.attribute("value")
        }
    }
    return ret
}

// Properties exported here are visible to all plugins.
ext {
    // These helpers are shared, but are not guaranteed to be stable / unchanged.
    privateHelpers = {}
    privateHelpers.getProjectTarget = { doGetProjectTarget() }
    privateHelpers.findLatestInstalledBuildTools = { doFindLatestInstalledBuildTools('19.1.0') }
    privateHelpers.extractIntFromManifest = { name -> doExtractIntFromManifest(name) }
    privateHelpers.promptForPassword = { msg -> doPromptForPassword(msg) }
    privateHelpers.ensureValueExists = { filePath, props, key -> doEnsureValueExists(filePath, props, key) }

    // These helpers can be used by plugins / projects and will not change.
    cdvHelpers = {}
    // Returns a XmlParser for the config.xml. Added in 4.1.0.
    cdvHelpers.getConfigXml = { doGetConfigXml() }
    // Returns the value for the desired <preference>. Added in 4.1.0.
    cdvHelpers.getConfigPreference = { name, defaultValue -> doGetConfigPreference(name, defaultValue) }
}
csantanapr

해당 플러그인은 더 이상 사용되지 않습니다. 해당 플러그인을 대체하는 새 플러그인을 사용해보세요.

https://github.com/phonegap/phonegap-plugin-push

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Android Studio AutoFormat 플러그인

분류에서Dev

Cordova sqlite 플러그인 android regexp 함수

분류에서Dev

Cordova Android 플러그인 디버깅

분류에서Dev

Cordova Android 플러그인 : Cordova가 덮어 쓴 config.xml 준비?

분류에서Dev

Android Studio 및 Bitbucket 플러그인

분류에서Dev

Java 플러그인 용 Android Studio Cucumber

분류에서Dev

Android Studio 및 Genymotion 플러그인

분류에서Dev

Android 플랫폼에서 Cordova 플러그인 충돌

분류에서Dev

Cordova 미디어 캡처 플러그인 버그 (Nexus 6, Android 6)

분류에서Dev

Cordova 로컬 플러그인 (Visual Studio 2015) 문제

분류에서Dev

Visual Studio 2013-Cordova 파일 플러그인 문제

분류에서Dev

Cordova + Android Studio 오류 : 'com.android.build.gradle.BasePlugin'이 플러그인 인터페이스를 구현하지 않습니다.

분류에서Dev

cordova-plugin-googlemaps 및 ibm-mfp-push 플러그인을 포함하는 앱을 빌드하는 Gradle "com.android.dex.DexException"

분류에서Dev

Android Studio에 Cordova 플러그인을 설치하고 Android 프로젝트를 개발하는 방법은 무엇입니까?

분류에서Dev

iOS의 bms-push cordova 플러그인은 다음을 제공합니다.

분류에서Dev

Cordova Android fcm 플러그인 jquery php 배경 알림 클릭시

분류에서Dev

Cordova Custom Android 레이아웃 플러그인

분류에서Dev

네이티브 Android 앱용 Cordova 플러그인

분류에서Dev

Cordova Ace 플러그인을 통해 Android 활동 시작

분류에서Dev

Wikitude Cordova 플러그인-Android 및 iOS 오류 처리

분류에서Dev

Visual Studio 2013 Cordova 하이브리드 앱 플러그인 : apk 파일의 위치

분류에서Dev

Visual Studio 2013 Cordova 하이브리드 앱 플러그인 : apk 파일의 위치

분류에서Dev

Visual Studio Cordova 플러그인은 iOS 빌드에 포함되지 않습니다.

분류에서Dev

ID가 'Android'인 Cordova 플러그인을 찾을 수 없습니다.

분류에서Dev

Android-Android Studio 대 Apache Cordova

분류에서Dev

플러그인 cordova BluetoothLE

분류에서Dev

Cordova SMS 플러그인

분류에서Dev

Cordova 플러그인의 count ++

분류에서Dev

Meteor Cordova Print 플러그인

Related 관련 기사

  1. 1

    Android Studio AutoFormat 플러그인

  2. 2

    Cordova sqlite 플러그인 android regexp 함수

  3. 3

    Cordova Android 플러그인 디버깅

  4. 4

    Cordova Android 플러그인 : Cordova가 덮어 쓴 config.xml 준비?

  5. 5

    Android Studio 및 Bitbucket 플러그인

  6. 6

    Java 플러그인 용 Android Studio Cucumber

  7. 7

    Android Studio 및 Genymotion 플러그인

  8. 8

    Android 플랫폼에서 Cordova 플러그인 충돌

  9. 9

    Cordova 미디어 캡처 플러그인 버그 (Nexus 6, Android 6)

  10. 10

    Cordova 로컬 플러그인 (Visual Studio 2015) 문제

  11. 11

    Visual Studio 2013-Cordova 파일 플러그인 문제

  12. 12

    Cordova + Android Studio 오류 : 'com.android.build.gradle.BasePlugin'이 플러그인 인터페이스를 구현하지 않습니다.

  13. 13

    cordova-plugin-googlemaps 및 ibm-mfp-push 플러그인을 포함하는 앱을 빌드하는 Gradle "com.android.dex.DexException"

  14. 14

    Android Studio에 Cordova 플러그인을 설치하고 Android 프로젝트를 개발하는 방법은 무엇입니까?

  15. 15

    iOS의 bms-push cordova 플러그인은 다음을 제공합니다.

  16. 16

    Cordova Android fcm 플러그인 jquery php 배경 알림 클릭시

  17. 17

    Cordova Custom Android 레이아웃 플러그인

  18. 18

    네이티브 Android 앱용 Cordova 플러그인

  19. 19

    Cordova Ace 플러그인을 통해 Android 활동 시작

  20. 20

    Wikitude Cordova 플러그인-Android 및 iOS 오류 처리

  21. 21

    Visual Studio 2013 Cordova 하이브리드 앱 플러그인 : apk 파일의 위치

  22. 22

    Visual Studio 2013 Cordova 하이브리드 앱 플러그인 : apk 파일의 위치

  23. 23

    Visual Studio Cordova 플러그인은 iOS 빌드에 포함되지 않습니다.

  24. 24

    ID가 'Android'인 Cordova 플러그인을 찾을 수 없습니다.

  25. 25

    Android-Android Studio 대 Apache Cordova

  26. 26

    플러그인 cordova BluetoothLE

  27. 27

    Cordova SMS 플러그인

  28. 28

    Cordova 플러그인의 count ++

  29. 29

    Meteor Cordova Print 플러그인

뜨겁다태그

보관