PushPlugin编译失败exitcode 1

时间:2015-09-14 15:03:11

标签: android cordova

我开发了一个简单的应用程序,可以使用visual studio 2015中的cordova框架接收推送。我上周完成了我的示例应用程序,但出于某种原因,由于推送插件库,它今天拒绝编译({ {3}})。我得到的第一个错误是。

1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample4\platforms\android\AndroidManifest.xml:24:5 Error: (TaskId:11)
1>      uses-sdk:minSdkVersion 10 cannot be smaller than version 13 declared in library C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample4\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v13\22.2.1\AndroidManifest.xml (TaskId:11)
1>  :processDebugManifest FAILED (TaskId:11)
1>      Suggestion: use tools:overrideLibrary="android.support.v13" to force usage (TaskId:11)
1>   (TaskId:11)
1>  FAILURE: Build failed with an exception. (TaskId:11)
1>   (TaskId:11)
1>  * What went wrong: (TaskId:11)
1>  Execution failed for task ':processDebugManifest'. (TaskId:11)
1>  > Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 13 declared in library C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample4\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v13\22.2.1\AndroidManifest.xml (TaskId:11)
1>      Suggestion: use tools:overrideLibrary="android.support.v13" to force usage (TaskId:11)

我按照编译器给我的指示,通过改变我的清单:

  • 添加xml命名空间工具:xmlns:tools =" http://schemas.android.com/tools"

  • 为sdk支持添加行:

  • 设置minSdkVersion> 10

这是完整的清单文件:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="io.cordova.myapp2f4e1e" xmlns:android="http://schemas.android.com/apk/res/android" **xmlns:tools="http://schemas.android.com/tools"**>
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    **<use-sdk tools:overrideLibrary="android.support.v13" />**
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name="msopentech.azure.NotificationHub$PushNotificationReceiver" android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="io.cordova.myapp2f4e1e" />
            </intent-filter>
        </receiver>
        <activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" />
        <receiver android:name="com.adobe.phonegap.push.CordovaGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="io.cordova.myapp2f4e1e" />
            </intent-filter>
        </receiver>
        <service android:name="com.adobe.phonegap.push.GCMIntentService" />
    </application>
    **<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />**
    <permission android:name="io.cordova.myapp2f4e1e.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="io.cordova.myapp2f4e1e.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
</manifest>

接下来我得到的是海啸,找不到符号&#39;错误,这里有几个:

  symbol:   variable COUNT (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:201: error: cannot find symbol (TaskId:11)
1>                  } else if (key.equals(SOUNDNAME) || key.equals(SOUND)) { (TaskId:11)
1>                                        ^ (TaskId:11)
1>    symbol:   variable SOUNDNAME (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:201: error: cannot find symbol (TaskId:11)
1>                  } else if (key.equals(SOUNDNAME) || key.equals(SOUND)) { (TaskId:11)
1>                                                                 ^ (TaskId:11)
1>    symbol:   variable SOUND (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:202: error: cannot find symbol (TaskId:11)
1>                      json.put(SOUND, value); (TaskId:11)
1>                               ^ (TaskId:11)
1>    symbol:   variable SOUND (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:203: error: cannot find symbol (TaskId:11)
1>                  } else if (key.equals(IMAGE)) { (TaskId:11)
1>                                        ^ (TaskId:11)
1>    symbol:   variable IMAGE (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:204: error: cannot find symbol (TaskId:11)
1>                      json.put(IMAGE, value); (TaskId:11)
1>                               ^ (TaskId:11)
1>    symbol:   variable IMAGE (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  C:\Code\Javascript\CordovaProjects\PushNotificationSolution\Sample3\platforms\android\src\com\adobe\phonegap\push\PushPlugin.java:205: error: cannot find symbol (TaskId:11)
1>                  } else if (key.equals(CALLBACK)) { (TaskId:11)
1>                                        ^ (TaskId:11)
1>    symbol:   variable CALLBACK (TaskId:11)
1>    location: class PushPlugin (TaskId:11)
1>  100 errors (TaskId:11)
1>   (TaskId:11)
1>  FAILURE: Build failed with an exception. (TaskId:11)
1>   (TaskId:11)
1>  * What went wrong: (TaskId:11)
1>  Execution failed for task ':compileDebugJava'. (TaskId:11)
1>  :compileDebugJava FAILED (TaskId:11)
1>  > Compilation failed; see the compiler error output for details. (TaskId:11)
1>   (TaskId:11)
1>  * Try: (TaskId:11)
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. (TaskId:11)
1>   (TaskId:11)
1>  BUILD FAILED (TaskId:11)
1>   (TaskId:11)
1>  Total time: 4.827 secs (TaskId:11)

我不知道如何修复它或者我可能做了什么来使pushplugin停止工作。有没有人在使用这个插件时遇到同样的问题?

1 个答案:

答案 0 :(得分:0)

我刚刚安装了https://github.com/phonegap/phonegap-plugin-push,它也为我带来了同样的问题。

我遵循HighFive's建议:

如果你进入你的config.xml文件并在android选项卡下设置它13,保存文件,并构建你应该没问题。

至少它是为我而建的。即将测试功能。

更新:能够提取一个注册,以便它可以通过此更改实现。