Skip to content

WARNING: Dependency org.json:json:20090211 is ignored for debug #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JTallis opened this issue Feb 9, 2015 · 22 comments
Closed

WARNING: Dependency org.json:json:20090211 is ignored for debug #13

JTallis opened this issue Feb 9, 2015 · 22 comments

Comments

@JTallis
Copy link

JTallis commented Feb 9, 2015

I recently found this repository and so I added the compile statement to my build.gradle and it creates these warnings on debug:

WARNING: Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
WARNING: Dependency org.json:json:20090211 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages

I'm running android 4.4.4 on my device.

@nkzawa
Copy link
Contributor

nkzawa commented Feb 10, 2015

Yeah, I know that but we can't remove the dependency since this library is not only for Android.
Anyway I believe there is no problem with functionality though it's annoying.
Do you know a good way to suppress these warnings?

@JTallis
Copy link
Author

JTallis commented Feb 10, 2015

I don't know a way to suppress the warnings however would it be possible to check if the OS being ran is android and to do something else?

@mdellerie
Copy link

You can exclude json dependency from the module by adding the following lines in your build.gradle :

compile ('com.github.nkzawa:socket.io-client:0.4.1'){
exclude group: 'org.json', module: 'json'
}

This worked for me : no warning anymore :)

@heinhtetaung92
Copy link

Thanks mdellerie,
That works for me too. Thanks for answer. :)

@mdellerie
Copy link

You're welcome! ;-)

@alemures
Copy link

I was getting those annoying warnings as well and it solved my problem, thanks @mdellerie !

@mdellerie
Copy link

my pleasure ! ;)

@akamadya
Copy link

wow, thank's

@binhtvt
Copy link

binhtvt commented Nov 25, 2015

Thank you @mdellerie 👍

@nkzawa
Copy link
Contributor

nkzawa commented Dec 12, 2015

Added to README. Thanks, @mdellerie !

@nkzawa nkzawa closed this as completed Dec 12, 2015
@MikeSoft
Copy link

thanks @mdellerie

@Chheata
Copy link

Chheata commented Feb 16, 2017

@mdellerie I use this
compile 'org.json:json:20151123'

and after I add this
compile 'com.github.nkzawa:socket.io-client:0.3.0'{
exclude group: 'org.json', module: 'json'
}

it still not work 😢😥

@vishaljadav24
Copy link

@Chheata Use this:
compile ('com.github.nkzawa:socket.io-client:0.4.1'){
exclude group: 'org.json', module: 'json'
}

It's works for me. Thanks @mdellerie

@MuhammadjonTohirov
Copy link

try to use this library.
compile 'org.json:org.json:chargebee-1.0'

@ladykat
Copy link

ladykat commented Jun 24, 2017

Hi guys!
I tried to use this: compile ('com.github.nkzawa:socket.io-client:0.4.1'){
exclude group: 'org.json', module: 'json'
}

But doesn't work too!

Error message as follows, help please?
Error:Could not find method compile() for arguments [com.github.nkzawa:socket.io-client:0.4.1, build_cunlaeueny2t2ajmdz9zk0q17$_run_closure7@31411f8f] on project ':android' of type org.gradle.api.Project.

@DanChab
Copy link

DanChab commented Sep 16, 2017

Many thanks, worked for me too

@serrokitskiy
Copy link

@ladykat You must add comma)))
replace
compile 'com.github.nkzawa:socket.io-client:0.4.1' {
exclude group: 'org.json', module: 'json'
}
to
compile 'com.github.nkzawa:socket.io-client:0.4.1', {
exclude group: 'org.json', module: 'json'
}

@wajdan846
Copy link

great thanks mdellerie

@silentcontrol00
Copy link

@serrokitskiy Hay Bro,thank alot for your answer.
it work for me Bro.

@ghost
Copy link

ghost commented Mar 24, 2018

Warning:WARNING: Dependency org.json:json:20140107 is ignored for withAnalyticsDebug as it may be conflicting with the internal version provided by Android. how to solve this
???????????

@RishabhS05
Copy link

RishabhS05 commented Apr 13, 2018

thanks .... : )

@Masoud2159
Copy link

Hi!
I tried to use this:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
compile 'com.github.nkzawa:socket.io-client:0.4.1', {
exclude group: 'org.json', module: 'json'
}

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

But doesn't work!

Error message as follows, help, please?

Could not find method compile() for arguments [com.github.nkzawa:socket.io-client:0.4.1, build_7vmonel3c4y8lhnndnc10z8wh$_run_closure1$_closure3$_closure4@388f4cb] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

lamrongol added a commit to lamrongol/socket.io-client-java that referenced this issue Apr 28, 2023
Previously, the exclude was required( socketio/engine.io-client-java#13 ), but this was probably due to the fact that com.github.nkzawa:socket.io-client was used. Rather, now if you exclude it, you will get `java.lang.ClassNotFoundException: org.json.JSONException`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests