Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

GCMIntentService.java:139: error: cannot find symbol mBuilder.setColor(iconColor); #51

Closed
mwillbanks opened this issue Jul 30, 2015 · 50 comments
Assignees
Labels
Milestone

Comments

@mwillbanks
Copy link

symbol: method setColor(int)
location: variable mBuilder of type Builder

@macdonst
Copy link
Member

@mwillbanks What version of Android are you using?

@macdonst macdonst added the bug label Jul 31, 2015
@macdonst macdonst added this to the Release 1.2.0 milestone Jul 31, 2015
@macdonst macdonst self-assigned this Jul 31, 2015
@macdonst
Copy link
Member

@mwillbanks are you using the "android-support-v13.jar" that is provided in this project? It contains the proper jar that has the setColor method.

@macdonst macdonst added question and removed bug labels Jul 31, 2015
@macdonst
Copy link
Member

@mwillbanks I tested on a 4.4.4 device this afternoon with no problems.

@hirbod
Copy link

hirbod commented Aug 11, 2015

I've the same problem right now. I needed to delete the support-v13 reference cause by "multiple dex" warnings. I can't any way to get this plugin compile.

@Dr-Horv
Copy link

Dr-Horv commented Aug 11, 2015

Having the same problem. With support-v13 file in platforsm/android/libs I get multiple dexfiles error. If I "android-support-v13.jar" then I get this problem.

@hirbod
Copy link

hirbod commented Aug 11, 2015

I give up. Struggeled more then 4 days with this problem and I can't get any support on this. As soon as Facebook is integrated (or any other plugin which needs the v13 support, we get this)

v13 support seems to be integrated only because of the "setColor()" method. Now my notifications look ugly, but I've commented out the line to get the build compiled.

@mwillbanks
Copy link
Author

@hirbod you need to remove the support library from the facebook SDK, basically search your codebase for where the items are before you build...

AKA:

find platforms/android -name "android-support*.jar" | grep -v build

If you find duplicates or multiple versions, remove the multiple versions. You can only have 1 support library in your project. The issue becomes is that many plugins attempt to ship one and it causes conflicts between projects. I suggest removing all support libraries that a plugin has and then to manually place one in your libs folder.

@hirbod
Copy link

hirbod commented Aug 11, 2015

Thank you very much. If I remove the support lib from facebook, I can't compile. The only working solution for me was to remove all support libs from /libs/ inside of platform/android and to leave one support file inside of facebook (I have "CCSoft" Facebook plugin installed, the SDK isn't inside of my platform folder, it's placed in my download folder and got referenced manually inside of eclipse as library).

I can't switch to any other facebook plugin at the moment, but I will try your suggestion, maybe I can find a way.

@hirbod
Copy link

hirbod commented Aug 11, 2015

I tried your "find" command. No results. :( @mwillbanks

@mwillbanks
Copy link
Author

Interesting, your paths might be references differently than provided your earlier comment then; all of mine are inside of the platforms/android folder itself. You would need to add the additional paths in that case.

For instance:

find platforms/android -name "android-support*.jar" | grep -v build
platforms/android/com.phonegap.plugins.facebookconnect/app-FacebookLib/libs/android-support-v13.jar
platforms/android/libs/android-support-v13.jar

@hirbod
Copy link

hirbod commented Aug 11, 2015

I've removed android-support-v13.jar from the /libs/ folder. Also the v4.jar.
I don't use the facebookconnect plugin, my support-v13 lib is inside

/Users/myname/Downloads/facebooksdk/facebook/libs/android-support-v13.jar

I've integrated the facebook-plugin the official way (as described on developers.facebook.com)
At the time of choosing this plugin, the official one was very buggy, that was the reason I decided to use a different plugin). If I don't find a way, I will have to switch my facebook plugin to the famous one. Seems like they have fixed the problems.

I'm using this one:
https://github.com/huttarichard/cordova-facebook

Before I've installed this plugin, everything worked. I need to find a way to compile both plugin-push and facebook. I need a way to tell the external lib to use the libs inside of cordova, not it's own, but I googled like 10 hours for that problem and I feel desperate :/

@hirbod
Copy link

hirbod commented Aug 11, 2015

@mwillbanks and @macdonst

I've removed the facebook plugin and also the push plugin, removed android platform, readded android platform and the push plugin, but I get this error message:

/.../platforms/android/src/com/adobe/phonegap/push/GCMIntentService.java:139: error: cannot find symbol
            mBuilder.setColor(iconColor);

When I look inside of my /libs/ folder, there is support-v13.jar and support-v4.jar

I've opened the plugin folder, support-v13 and gcm.jar are inside.
Inside of plugin.xml I can see:

        <source-file src="src/android/libs/android-support-v13.jar" target-dir="libs/" />

So what's wrong now?

Cordova Android 4.1.0
Android Device: 4.4.2 (Sony Xperia) and 5.1.1 (Samsung Galaxy S6 Edge)

@hirbod
Copy link

hirbod commented Aug 11, 2015

Hi again, sorry for that spam. For everybody who stuck on this, I've managed to get this work.
Go inside of plugins/phonegap-plugin-push/src/android/libs/ and copy android-support-v13.jar

Copy it and replace with the one inside of platforms/android/src

Double-Check that there is NO android-support-v4.jar inside of it. When you find v4, just delete it. Now, the plugin build without problems. If you don't remove v4, it wont work.

I will change my facebook plugin to https://github.com/jeduan/cordova-plugin-facebook4 as this one seems to be a drop-in-replacement and much more active then the official one or the cc-soft one. They also have fixed the multiple DEX problem.

@macdonst
Copy link
Member

@hirbod I'm glad you got it resolved. As soon as PhoneGap Build supports gradle I'm switching this plugin to use the "framework" tag which should avoid these dexing problems for good.

@hirbod
Copy link

hirbod commented Aug 11, 2015

@macdonst thank you very much. My app is working perfectly right now. Push work's also as expected now. Finally 💃

@Dr-Horv
Copy link

Dr-Horv commented Aug 12, 2015

@macdonst I'm having similiar issue as Hirbod. Although I cannot seem to resolve it by the same steps. I've tried about anything and lost track of what I have and haven't tried. I've concluded that the facebook-connect plugin I'm using https://github.com/uofmmike/phonegap-facebook-plugin clashes with this one on the support-library thing. It seems in either way I remove them respectively plugin doesn't compile. Do you have any tips of step to try resolve this?

Would it be hard to change this plugin to use framework tag? I'm not using phone gap build, rather cordova build. Which as I understand it has gradle support.

@macdonst
Copy link
Member

@Dr-Horv yeah, the fix is crazy easy to implement and in fact there is already a PR waiting for when PGB is ready.

keab42@472548a

I will try and use the Facebook plugin with this plugin in an app later to see if there is anything I can do in the meantime.

@untitledlt
Copy link

@hirbod did you mean platforms/android/lib/?
I tried your suggestion but that does not help.

@macdonst I have tried to replace those lines as in keab42/phonegap-plugin-push@472548a but that does not help either...

Any other fixes available?

@shprink
Copy link

shprink commented Sep 2, 2015

If you are having trouble with Facebook plugin, this fixes it:

cp platforms/android/libs/android-support-v13.jar platforms/android/com.phonegap.plugins.facebookconnect/active-FacebookLib/libs/
rm platforms/android/com.phonegap.plugins.facebookconnect/active-FacebookLib/libs/android-support-v4.jar

@000panther
Copy link

Why is everyone embedding JARs in their Plugins? I thought the new way to to it was using

<platform name="android"> <framework src="com.google.android.gms:play-services-gcm:+" /> </platform>

To pull in dependencies via gradle, and avoid all these conflicts?

@macdonst
Copy link
Member

macdonst commented Sep 7, 2015

@hobbysoldat you are correct. However, PhoneGap Build does not support Gradle yet so I haven't made the switch. I think when I get back off vacation I will switch it and PGB users will have to use version 1.2.2 or earlier.

@000panther
Copy link

Good to hear! Sorry for the dupe, thought this would better fit in its own topic.

@macdonst
Copy link
Member

macdonst commented Sep 8, 2015

@hobbysoldat no problem, I'm just trying to keep all the discussion on this topic in one thread.

@kentmw
Copy link

kentmw commented Oct 19, 2015

Has anyone experienced this issue while using Phonegap Build to assemble the apk?

@hirbod
Copy link

hirbod commented Oct 19, 2015

Missing symbols. Add android support and google play library via sdk manager

@kentmw
Copy link

kentmw commented Oct 19, 2015

@hirbod, sorry, was that comment directed at my question? Phonegap Build, or PGB, found here: https://build.phonegap.com, builds the application in the "cloud" or at least on adobe's server. I don't have access or control of sdk manager while using PGB

@hirbod
Copy link

hirbod commented Oct 20, 2015

hi @kentmw - sorry, I mixed something up with email notification. Please ignore my message

@adyz
Copy link

adyz commented Oct 21, 2015

I have this issue too. Any solutions that do not imply removing facebook plugin?

@000panther
Copy link

Yes. there is a version of the facebook plugin that works with this plugin.
just look at this plugins readme page, it has been updated.

phonegap plugin add https://github.com/jeduan/cordova-plugin-facebook4

2015-10-21 14:44 GMT+02:00 Florescu Adrian notifications@github.com:

I have this issue too. Any solutions that do not imply removing facebook
plugin?


Reply to this email directly or view it on GitHub
#51 (comment)
.

Paul Weber, BSc.
Tel: +43(0)699 18 144 914

@000panther
Copy link

It uses gradle dependencies instead of hardcoding stuff.

2015-10-21 15:39 GMT+02:00 Paul Weber p4ul.weber@gmail.com:

Yes. there is a version of the facebook plugin that works with this
plugin. just look at this plugins readme page, it has been updated.

phonegap plugin add https://github.com/jeduan/cordova-plugin-facebook4

2015-10-21 14:44 GMT+02:00 Florescu Adrian notifications@github.com:

I have this issue too. Any solutions that do not imply removing facebook
plugin?


Reply to this email directly or view it on GitHub
#51 (comment)
.

Paul Weber, BSc.
Tel: +43(0)699 18 144 914

Paul Weber, BSc.
Tel: +43(0)699 18 144 914

@adyz
Copy link

adyz commented Oct 21, 2015

With facebook4 I get another type of error... :(

@adyz
Copy link

adyz commented Oct 21, 2015

This to be more exact:

    FAILURE: Build failed with an exception.

    * What went wrong:
        Execution failed for task ':processArmv7DebugManifest'.
    > Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library /Users/adrian/Desktop/Vivre/Setup-Centos-PuPHPet/cordova-app-push/platforms/android/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.7.0/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="com.facebook" to force usage

@hirbod
Copy link

hirbod commented Oct 21, 2015

I know this error. You're using Crosswalk @adyz and there is currently a bug.

You need to run like that

> cordova run android -- --minSdkVersion=15

or when you want to release it

> cordova run android --release -- --minSdkVersion=15

Did you see the double -- ? Yes, it has to be EXACTLY like this, or it won't work.

@adyz
Copy link

adyz commented Oct 21, 2015

@hirbod Thanks a ton!!!

I'm new to all this (cordova, android, ios) and it's a bit overwhelming.

@000panther
Copy link

or you could add
to your config.xml

2015-10-21 16:50 GMT+02:00 Florescu Adrian notifications@github.com:

@hirbod https://github.com/Hirbod Thanks a ton!!!

I'm new to all this (cordova, android, ios) and it's a bit overwhelming.


Reply to this email directly or view it on GitHub
#51 (comment)
.

Paul Weber, BSc.
Tel: +43(0)699 18 144 914

@hirbod
Copy link

hirbod commented Oct 21, 2015

Will not work when crosswalk is installed as it gets overwritten

@ndvbd
Copy link

ndvbd commented Nov 24, 2015

Guys - I see you're talking about the libs folder inside /platforms/android - but I don't have one...
How come?

@macdonst
Copy link
Member

@NadavB because we no longer need to add jars to this plugin. They've been replaced with frameworks.

@bvivek20
Copy link

Agreed that jars are not added now, but i still get this error GCMIntentService.java:565: error: cannot find symbol

@macdonst
Copy link
Member

@bvivek20 update your Android Support Library.

@bvivek20
Copy link

i already did that. new version is 23.1.1

i removed and added android platform again, i still get this error

@JerryBels
Copy link

Having the same issue, running latest version of Cordova, all is up to date in the Android SDK manager, and tried to remove and add the platform / the plugin many times...

Note that I also removed the Facebook plugin completely (as well as another one with android-support dependency) then it builds. But whenever I'm adding again any of those 2 plugins (Facebook or the other one) build fails.

:compileDebugJava myprojectpath\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:565: 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
 FAILED

@fredgalvao
Copy link
Collaborator

@JerryBels That's a bug in these other plugins you mentioned, not on phonegap-plugin-push. Report an issue to their authors and request it to be updated to support gradle builds and framework dependencies.

@Apee
Copy link

Apee commented Dec 11, 2015

Wow thanks a lot guys the combination of @hirbod and @hobbysoldat made it work for me ! THANKS!!!!

@zabojad
Copy link

zabojad commented Feb 11, 2016

I'm experiencing this error but reading at your previous comments, I'm not really sure what I should do. Here is what I have:

platforms/android/src/com/adobe/phonegap/push/GCMIntentService.java:571: error: cannot find symbol
            mBuilder.setColor(iconColor);

And:

$ find platforms/android -name "android-support*.jar" | grep -v build
platforms/android/phonegap-facebook-plugin/wink-FacebookLib/libs/android-support-v4.jar
$ cordova plugin list
cordova-plugin-crosswalk-webview 1.5.0 "Crosswalk WebView Engine"
cordova-plugin-whitelist 1.2.0 "Whitelist"
phonegap-facebook-plugin 0.12.0 "Facebook Connect"
phonegap-plugin-push 1.5.2 "PushPlugin"

With latest version of Android support lib installed (23.1.1) and android target freshly removed/re-added.

If I just remove platforms/android/phonegap-facebook-plugin/wink-FacebookLib/libs/android-support-v4.jar, it does not compile neither...

What should be done ?

@zabojad
Copy link

zabojad commented Feb 11, 2016

Uups, I've posted too fast, the issue actually comes from the facebook plugin and I've managed to fix this issue with this: Wizcorp/phonegap-facebook-plugin#1183

@fredgalvao
Copy link
Collaborator

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests