regarding to http://docs.ionic.io/docs/push-from-scratch
I added the web client with ionic add ionic-platform-web-client and
I added the push plugin with ionic plugin add phonegap-plugin-push to my project.
If I run ionic run ios --device on my mac for my iPhone, everything is fine. Later I can recive one-time dev-push-notifications I send from my account on http://ionic.io
BUT if I run ionic run android --device on Windows, Iâm getting this weird error output:
Running command: "C:\Program Files\nodejs\node.exe" T:\Coding\MyApp\hooks\after_prepare\010_add_platform_class.js T:\Coding\MyApp
add to body class: platform-android
Running command: cmd "/s /c "T:\Coding\MyApp\platforms\android\cordova\run.bat --device""
ANDROID_HOME=C:\Users\itsme\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_79
Running: T:\Coding\MyApp\platforms\android\gradlew cdvBuildDebug -b T:\Coding\MyApp\platforms\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find any version that matches com.android.support:support-v13:23+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v13/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v13/
file:/C:/Users/itsme/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v13/maven-metadata.xml
file:/C:/Users/itsme/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v13/maven-metadata.xml
file:/C:/Users/itsme/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v13/
Required by:
:android:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 22.476 secs
T:\Coding\MyApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "T:\Coding\MyApp\platforms\android\gradlew cdvBuildDebug -b T:\Coding\MyApp\platforms\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to run this project
After calling ionic build android I get this error:
...
:compileDebugJavaT:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:11: error: package com.almworks.sqlite4java does not exist
import com.almworks.sqlite4java.*;
^
T:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:365: error: cannot find symbol
SQLiteConnection mydb;
^
symbol: class SQLiteConnection
location: class SQLitePlugin.SQLiteDatabaseNDK
T:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:229: error: cannot find symbol
} catch (SQLiteException e) {
^
symbol: class SQLiteException
location: class SQLitePlugin
T:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:374: error: cannot find symbol
mydb = new SQLiteConnection(dbFile);
^
symbol: class SQLiteConnection
location: class SQLitePlugin.SQLiteDatabaseNDK
T:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:486: error: cannot find symbol
SQLiteStatement myStatement = mydb.prepare(query);
^
symbol: class SQLiteStatement
location: class SQLitePlugin.SQLiteDatabaseNDK
T:\Coding\MyApp\platforms\android\src\io\liteglue\SQLitePlugin.java:531: error: strings in switch are not supported in -source 1.6
switch (myStatement.columnType(i)) {
^
(use -source 7 or higher to enable strings in switch)
Note: Some input files use or override a deprecated API.
FAILED
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 47.79 secs
T:\Coding\MyApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "T:\Coding\MyApp\platforms\android\gradlew cdvBuildDebug -b T:\Coding\MyApp\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
But before adding phonegap-plugin-push it worked. So why this (first) error? Changing the build.gradle file caused this second error ⌠So changing build.gradle causes an error in the sqlite-plugin? I donât understand how.
Had the same issue.
You shouldnât touch gradle file.
Just update/install:
a) Android Support Repository and Android Support Library
b) Google Repository and Google Play services
Yes, i installed it from SDK Manager.
First time I had the same mistake as you [quote=âHappyHappyJoyJoy, post:1, topic:38492â]
Could not find any version that matches com.android.support:support-v13:23+.
[/quote]
I installed 2 points Android Support Repository and Android Support Library.
Then I had another error (something about âplay-services-gcmâ). I installed Google Repository and Google Play services from SDK.
After that everything builds fine.
Donât remember exactly, but it seems, I removed /platforms/andoid folder and then used âionic platform add androidâ again in CLI.
Install the plugin cordova-android-support-v4 (from memory) directly, as android.support.v4 resolves to this npm name then bugs out when it finds the ID does not match - ironically, âandroid.support.v4â.
Make certain you have Google Play Services and also Support installed through the Android SDK manager.
Android plugins after 3.3.1-0.2.1 use Gradle. If youâre using PhoneGap prior to ⌠a release in March, in think, then itâll not have Gradle capabilities. The choice is then to upgrade PhoneGap, else manually grab each required jar files (from maven), and include one of the manual googleplay-support plugins from GitHub. Thereâs ones for versions 19, 21, 25 of this library, and Iâve put up one recently for v28.0.0 (current) a.k.a. 8.3.0.