Gradle error, Could not find method jcenter() for arguments [] on repository container

Could not find method jcenter()

When i tried to see project dependencies using gradle command in Android Studio Terminal, I get following error,Could not find method jcenter() for arguments [] on repository container.

project_path>gradle -q dependencies app
FAILURE: Build failed with an exception.
Where:
Build file 'projectpathbuild.gradle' line: 4
What went wrong:
A problem occurred evaluating root project 'ProjectName'.
> Could not find method jcenter() for arguments [] on repository container.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

i search for a solution and i see, this issue is due to AndroidStudio using old gradle, in which jcenter() is not supported. Not really sure about exact fix for this. But this following command worked fine,

project_path>gradlew -q :appName:dependencies
+--- project :simplecropimagelib
+--- project :library
| --- com.google.android.gms:play-services:+ -> 6.5.87
| --- com.android.support:support-v4:21.0.0 -> 21.0.2
| --- com.android.support:support-annotations:21.0.2
--- com.android.support:appcompat-v7:21.0.2
--- com.android.support:support-v4:21.0.2 (*)

*the appName you can see in settings.gradle file.

Hope it helps somebody…
Cheers:)

 

 

Quotes taken from status messages

status messages

These are few Inspiring Quotes i collected from status messages of my friends and different peoples. I really inspired and like the perception of my friends to use these quotations as status messages…

Krantik

  • Whatever it takes…. make it happen 🙂
  • Clarity gives Quality, Programming is about getting clarity on what you need to do.

RSuman

  • Don’t let someone become a priority in your life, when you are just an option in their life…
  • If there is a mountain to climb, Waiting won’t make it smaller or easier !!!!!!!
  • How you take off has nothing to do with how high you will fly!
  • Money cant buy happiness but somehow its more comfortable crying in a BMW than on a cycle!!
  • Always remember, Money is not everything in life, but make sure you earn sufficient before thinking such nonsense

Suha

  • A ship is safe in harbor– but that’s not what ships are for
  • Life is like a CHESS board, making right moves at the right time make a lot of difference…

Sathish

  • If you believe in yourself, you are on the first step of success’s stairs.
  • Winners Don’t Do Different Things They Do Things Differently….

RaviG

  • The secret of creativity is knowing how to hide your sources

Usha

  • If things seem too much, take a little time out for yourself. Once centered, you’ll realize how much good there really is in your life and you’ll feel a lot better

Sobhan

  • Study as if you were to live forever. Live as if you were to die tomorrow.

Saurin Parikh

  • When the going gets tough, the tough get going-Too Good- By Saurin Parikh

Govardhan

  • When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile.

Naresh

  • Faith is taking the first step even when you don’t see the whole staircase. Martin Luther King Jr.

Vogella

  • Never judge a man by his umbrella. It may not be his.

William Ellery Channing

  • It is not the quantity but the quality of knowledge which determines the mind’s dignity.

FB

  • In life and business, there are two cardinal sins. The first is to act precipitously without thought and the second is to not act at all.

EVILAKUMA

  • posted This below message as a comment for this song on youtube
    Jaane Kahan Gaye Woh Din – Raj Kapoor – Mera Naam Joker

    This song can give you tears of happiness or tears of pain , or maybe both.
    The clown was the most saddest person inside but he always smiled and made everyone else smile , he was heartbroken but he still lived , he died smiling and died teaching many how to smile and laugh.
    LIFE. Stay strong , never give up no matter how much darkness we have in our lives , we still have to learn to smile and keep on going and if you cant smile then bringing happiness in others hearts will keep u going.

🙂

26-1024x453

You may be also interested in

 

Know About Life! few wonderful lessons

Know About Life!, here are few descriptions of the Life, Hope you may like it.

life

The most selfish 1 letter word “I” Avoid it.
The most satisfying 2-letter word “WE” Use it.
The most poisonous 3-letter word “EGO” Kill it.
The most used 4-letter word “LOVE” Value it.
The most pleasing 5-letter word “SMILE” Keep it.
The fastest spreading 6-letter word “RUMOUR” Ignore it.
The hardest working 7-letter word “SUCCESS” Achieve it.
The most enviable 8-letter word “JEALOUSY” Distance it.
The most powerful 9-letter word “KNOWLEDGE” Acquire it.
The most essential 10-letter word “CONFIDENCE” Trust it.

 

A simple depiction of Live span.

Life

You may be also interested in

 

Useful Commands in a terminal/cmd prompt

Useful Commands

Here are few commands for Stop execution.

To stop execution of a command in the middle of a process..
On Linux terminal, Press Ctrl+Z. It will stop the execution..
On SQL terminal, Press Ctrl+C. It will stop the execution..
On Windows cmd(command prompt) terminal, Press Pause/Break button.

it stops the execution..

The following commands helps you to fix internet connectivity problem,

open cmd prompt as administrator. Below shows screenshot of opening cmd prompt as Administrator on windows 10.

commands

and now run these command

ipconfig /flushdns
ipconfig /registerdns
netsh

netsh>winsock reset

Now restart PC, you can see Internet problem fixed.

You may be also interested in following

 

 

Jar mismatch! Fix your dependencies, ADT Eclipse

I see this exception Jar mismatch! Fix your dependencies, while working on a project in ADT Eclipse editor

In the logcat, I see as below

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.

Solution for Jar mismatch

To fix this issue,

I followed following steps to fix

  • Right Click the project
  • Go To "Android Tools" > "Add Support Library"
  • Approve the permissions and let it update the library
  • If you have a library project, Repeat this process for the project App Library too.
  • Now Clean project and rebuild fixes the issue.

Jar mismatch

Hope it helps somebody

ref link: http://stackoverflow.com/a/24609733/341443

cheers 🙂

You may be also interested in

 

Quickest way to open a command prompt Windows

Quickest way to open a command prompt Windows

To open a command prompt quickly with a working directory of the current windows explorer folder on a Windows PC, you may try these

  • Hold Shift while Right-Clicking a blank space in the desired folder, you can see an option Open Command Window Here . This option available in vista, 7, 8 and 10 too

Quickest way

    • Open windows explorer, Click File menu at top left, you can see Open Command Prompt menu item, when you focus on it, it will open sub menu, with two options Open Command Prompt, and Open Command Prompt as As Administrator. Right-Click on a option and select Add to Quick Access Toolbar.

cmd_option3

cmd prompt will be added to Quick Access Toolbar at the top right as shown below, you can, So you can click on it whenever you need a cmd prompt with working directory

cmd_option2

cheers 🙂

You may be also interested in following

How to know Windows PC Motherboard model using Diagnostic Tool

At times, we may need to know PC Manufacturer, Motherboard model  etc details, to download and install PC drivers.

DirectX Diagnostic Tool to see Windows PC Motherboard model

Below is the steps to know these details..

  • In run dialog, type as dxdiag and press OK.

run

  • You can see the following dialog box, highlighted is the manufacturer and system model(Modelboard) details.

Motherboard model

Now you can Search and download supporting drivers.

Cheers…

You may be also interested in following

Add jar as library to Project, Android Studio

Add Jar file to a Project in Android Studio

Here are the steps to add Jar file to a Project in Android Studio

  • Put the jar file into the libs folder

add jar

  • Right click on jar file and select ‘Add as library’.

library_add-3

  • It’ll show a dialog showing modules in the project. Select a module to which you want add jar file.

library_add-4

  • Android Studio, automatically writes compile files('libs/<yourjarfile>.jar'); in gradle file dependencies and starts syncing and build file. And you are ready to use jar file classes.
  • If you see any issues, do a clean build might fix the issue.

Hope it helps somebody…

🙂

KMPlayer, not showing full screen videos anymore

I got a problem in KMPlayer, which it is showing videos only in the top left corner of the screen even in full screen. I tried reinstalling, but the problem wasn’t solved. I searched for a solution and found this.

Follow this instruction so as to preview “Advance Video Option” in your list
Right Click on the Kmplayer screen –> Go to “option” –> Select “Advance Menu”

then follow these steps:Start a movie then on the movie in kmplayer press right mouse button, then go to”Video(Advanced)/ Video renderer/ ..and choose video renderer as vmr9 renderless or Vmr widowed

Solved the issue….

Hope it helps someone…. 🙂

com.android.dex.DexException: Multiple dex files define, Android Studio

After moving an Eclipse project to Android Studio work space, and build project (Make Project), I see Build successful but when I run the project… I get the following exception, com.android.dex.DexException: Multiple dex files define

Multiple dex files

Error:Execution failed for task ':<projectname>:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
<home>AppDataLocalAndroidsdkbuild-tools21.1.2dx.bat --dex --no-optimize --output <home>AndroidStudioProjects<projectpath>buildintermediatesdexdebug --input-list=<home>AndroidStudioProjects<projectpath>buildintermediatestmpdexdebuginputList.txt
Error Code:2
Output: UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

after so much of struggle I found the issue is with dependencies of project gradle build file

dependencies {
compile project(':simplecropimagelib')
compile project(':library')
compile 'com.google.android.gms:play-services:+'
compile files('libs/acra-4.5.0.jar')
compile files('libs/android-support-v13.jar')
compile files('libs/core.jar')
compile files('libs/httpmime-4.2.3.jar')
compile files('libs/opencsv-2.3.jar')
compile files('libs/xstream-for-android-1.0.0.jar')
compile files('libs/zxingjar.jar')
compile 'com.android.support:appcompat-v7:21.0.2'
}

I find, this error occurs when you have the same library/directory included more than once in your build.gradle’s dependencies.
and in the above code, the issue is due to this line

compile files('libs/android-support-v13.jar')

which is included by other library project.

So, I just commented that line and run the Project, fixed the issue.

Phew….
Hope it helps somebody… cheers.. 🙂

note: If the dependency is declared as a dynamic version (like 1.+), Gradle will resolve this to the newest available static version (like 1.2) in the repository.