Unable to build apk #241

Closed
sebastiandanilonr opened this Issue Oct 19, 2015 · 7 comments

Projects

None yet

3 participants

@sebastiandanilonr

STACKTRACE:

:compileReleaseJava
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:43: error: cannot find symbol
PushPlugin.sendJavascript( json );
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:67: error: cannot find symbol
if (PushPlugin.isInForeground()) {
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:69: error: cannot find symbol
PushPlugin.sendExtras(extras);
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:87: error: cannot find symbol
Intent notificationIntent = new Intent(this, PushHandlerActivity
.class);
^
symbol: class PushHandlerActivity
location: class GCMIntentService
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
:compileReleaseJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileReleaseJava'.

    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: 1 mins 23.284 secs

D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\cordova\node_mo
dules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\GITHUB_proyectos\SapcoApp\Sap
coApp\SapcoApp\platforms\android\gradlew cdvBuildRelease -b D:\GITHUB_proyectos
SapcoApp\SapcoApp\SapcoApp\platforms\android\build.gradle -Dorg.gradle.daemon=tr
ue"
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
at ChildProcess.whenDone (C:\Program Files\nodejs\node_modules\cordova\node_
modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)


Hello, i got this error, seems problem with the Java Classes of the plugin, i already installed all the SDK needed extra libraries. Any ideas?

@macdonst
Member

@sebastiandanilonr what version of the plugin are you using because the "D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm" does not exist anywhere in the plugin. The source code for the plugin shoudl be in "D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\android\com\adobe\phonegap\push".

@sebastiandanilonr

The version is 1.3.0, or at leas that says cordova plugins list command

@macdonst
Member

@sebastiandanilonr how do you add the plugin to your project?

@sebastiandanilonr

@macdonst I was usying cordova plugins add phonegap-plugin-push, that uses npm.
I tried fetching it directly from the repo using cordova plugin add https://github
.com/phonegap/phonegap-plugin-push and this is the result when i try to build:

D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:16: error: package com.google.android.gcm does not exi
st
import com.google.android.gcm.GCMBaseIntentService;
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:19: error: cannot find symbol
public class GCMIntentService extends GCMBaseIntentService {
^
symbol: class GCMBaseIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:27: error: method does not override or implement a met
hod from a supertype
@Override
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:43: error: cannot find symbol
PushPlugin.sendJavascript( json );
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:53: error: method does not override or implement a met
hod from a supertype
@Override
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:58: error: method does not override or implement a met
hod from a supertype
@Override
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:67: error: cannot find symbol
if (PushPlugin.isInForeground()) {
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:69: error: cannot find symbol
PushPlugin.sendExtras(extras);
^
symbol: variable PushPlugin
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:84: error: cannot find symbol
NotificationManager mNotificationManager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);

^
symbol: method getSystemService(String)
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:85: error: incompatible types: GCMIntentService cannot
be converted to Context
String appName = getAppName(this);
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:87: error: cannot find symbol
Intent notificationIntent = new Intent(this, PushHandlerActivity
.class);
^
symbol: class PushHandlerActivity
location: class GCMIntentService
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:91: error: incompatible types: GCMIntentService cannot
be converted to Context
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
^
D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\src\com\plugin
gcm\GCMIntentService.java:148: error: method does not override or implement a me
thod from a supertype
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get
full output
13 errors
:compileReleaseJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileReleaseJava'.

    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: 2 mins 3.478 secs

D:\GITHUB_proyectos\SapcoApp\SapcoApp\SapcoApp\platforms\android\cordova\node_mo
dules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\GITHUB_proyectos\SapcoApp\Sap
coApp\SapcoApp\platforms\android\gradlew cdvBuildRelease -b D:\GITHUB_proyectos
SapcoApp\SapcoApp\SapcoApp\platforms\android\build.gradle -Dorg.gradle.daemon=tr
ue"
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
at ChildProcess.whenDone (C:\Program Files\nodejs\node_modules\cordova\node_
modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

@sebastiandanilonr

Ok, i think i solved, indeed the plugin was installed on ...\platforms\android\src\android\com\adobe\phonegap\push, but there was a residual folder "gcm" that had GCMIntentService.java on it and the build tried to compile it.

Thanks!

@macdonst
Member

Please close the issue if it is resolved.

@roshnibhuva

BUILD FAILED

Total time: 3.612 secs

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Build file 'D:\Roshni\Ionic\Business\platforms\android\build.gradle' line: 20

  • What went wrong:
    A problem occurred evaluating root project 'android'.

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : U
nsupported major.minor version 52.0

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.
    Picked up _JAVA_OPTIONS: -Xmx1024M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment