Reputation: 3338
I'm developing a simple application that can receive pushnotifications using the cordova framework in visual studio 2015. I did finish my sample application last week but for some reason it refuses to compile today because of the push plugin library ( https://github.com/phonegap/phonegap-plugin-push ). The first error i got was.
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)
I followed the instructions given to me by the compiler, by changing my manifest like this:
Add xml namespace tools: xmlns:tools="http://schemas.android.com/tools"
Add line for sdk support:
Set minSdkVersion > 10
Here is the full manifest file:
<?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>
Next thing i get is a tsunami of 'cannot find symbol' errors, here are a few:
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)
I have no idea how to fix it or what i might have done to make the pushplugin stop working. Is there anybody experiencing the same problems using this plugin?
Upvotes: 0
Views: 332
Reputation: 476
I just installed https://github.com/phonegap/phonegap-plugin-push as well and it generated the same problems for me.
I followed HighFive's suggestion:
If you go into your config.xml file and under the android tab set it 13, save the file, and build you should be ok.
At least it built for me. About to test functionality now.
UPDATE: Was able to pull a reg id so it is functional with this change.
Upvotes: 1