RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.02k stars 10.32k forks source link

building Cordova app for Android error after updating raix:push to the latest #1156

Closed solo999 closed 8 years ago

solo999 commented 8 years ago

After merging e83ee600e0c51faf6b3761a5f8f36d7f28f5a35a commit, I've got an error about building Cordova app for platform Android:

=> Errors executing Cordova commands:         

While building Cordova app for platform Android:
Error: /Users/vb/Sites/RocketChat/.meteor/local/cordova-build/platforms/android/cordova/build: Command failed with exit
code 8 Error output:

/Users/vb/Sites/RocketChat/.meteor/local/cordova-build/platforms/android/src/com/adobe/phonegap/push/GCMIntentService.java:483:
error: cannot find symbol
mBuilder.setColor(iconColor);
^
symbol:   method setColor(int)
location: variable mBuilder of type Builder
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.
1 error

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.

/Users/vb/Sites/RocketChat/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/vb/Sites/RocketChat/.meteor/local/cordova-build/platforms/android/gradlew with args:
cdvBuildRelease,-b,/Users/vb/Sites/RocketChat/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true
at ChildProcess.whenDone
(/Users/vb/.meteor/packages/meteor-tool/.1.1.9.1uwo8qg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

This it is probably related to the issue in Phonegap Push Plugin: https://github.com/phonegap/phonegap-plugin-push/issues/51 and can be temporarily solved by returning raix:push back to 2.6.13-rc.1 version

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

macdonst commented 8 years ago

@solo999 you'll need to update your Android SDK as per:

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

gmsecrieru commented 8 years ago

Is this fixed by updating Android SDK? Should we close this issue?

macdonst commented 8 years ago

@gmsecrieru Yes, if you update to Android Support Repository 20 or greater and Android Support Library 23 or greater then this error will go away.

Tharnas commented 8 years ago

Is this fixed in meteor12androidbuilder? ( https://github.com/RocketChat/Rocket.Chat/wiki/How-to-Build-Rocket.Chat-for-Android )

solo999 commented 8 years ago

@macdonst my Android Support Repository version is 24.0.0 and Android Support Library version is 23.1.0

@Tharnas I have built latest Rocket.Chat Android from docker image meteor12androidbuilder and got the same error.

@gmsecrieru I am not sure that it fixed by updating to Android Support Repository 20 or greater and Android Support Library 23. At least I have not managed to get rid of that error if raix:push package is the latest one (3.0.1)

solo999 commented 8 years ago

Update: if I add Crosswalk to meteor12androidbuilder before build, then there is no mBuilder.setColor(iconColor); error, but still it can not build apk:

root@80ec6c347a5d:/home/Rocket.Chat# meteor build --server http://demo.rocket.chat ./build      

WARNING: The output directory is under your source tree.

=> Errors executing Cordova commands:                                              

While building Cordova app for platform Android:
Error: /home/Rocket.Chat/.meteor/local/cordova-build/platforms/android/cordova/build: Command failed with
exit code 8 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.0.0+.
Required by:
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from
https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
> Could not GET
'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
> repo1.maven.org: unknown error

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log
output.

/home/Rocket.Chat/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/Rocket.Chat/.meteor/local/cordova-build/platforms/android/gradlew with args:
cdvBuildRelease,-b,/home/Rocket.Chat/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true
at ChildProcess.whenDone
(/root/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
Sing-Li commented 8 years ago

@solo999 For meteor12androidbuilder, please make sure you have all pre-reqs here, including the (large) machine and free disk requirements:

https://github.com/RocketChat/Rocket.Chat/wiki/How-to-Build-Rocket.Chat-for-Android

ALSO... please make 100% sure that you follow the readme here word-for-word...

https://hub.docker.com/r/rocketchat/meteor12androidbuilder/

In general, Meteor add, removal or change of platforms is not (yet) clean. You must start clean for things to work properly. You do not need, or want your own Android SDK, when using meteor12androidbuilder - the Docker image contains a properly configured and working one.

solo999 commented 8 years ago

@Sing-Li

I have Mac Book Air 8Gb and 100Gb SSD hard disk free. I have followed https://hub.docker.com/r/rocketchat/meteor12androidbuilder/ readme 100% 2 times (with or without Crosswalk). First time the result was the same as my first post, 2nd time - as in my previous post. I have run build 3rd time with

raix:push*  downgraded from 3.0.1 to 2.6.13-rc.1

and the it run smoothly without any errors.

gmsecrieru commented 8 years ago

I believe 2.6.13-rc.1 was created by @rodrigok and we didn't test 3.x properly before updating. Maybe we should just do away with 3.x.

cc @engelgabriel

Sing-Li commented 8 years ago

@solo999. Thanks for working this out with us. Your effort is most appreciated.

I have spent over a week to encapsulate the new android build environment. The builder will soon be part of our CI/CD pipeline (once we get a powerful server to do it in parallel).

macdonst commented 8 years ago

If you don't see the setColor method in NotificationCompat.Builder then it means you are not picking up the latest version of the Android Support Library. It's also possible that another part of this app is including an older version of android-support-v13.jar.

marceloschmidt commented 8 years ago

This is open for so long... hasn't this been fixed yet?

geekgonecrazy commented 8 years ago

Closing due to inactivity. Please let us know if you're still having issues. Or reach out to us on the demo server. We'll be glad to help you Thanks!

developer0017 commented 8 years ago

I got this error when run cordova project on terminal

Error: /Volumes/Working/Development/Cordova/plugin/opcv/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

How can I resolve this?