gradle project sync failed . android studio

2019-09-06 02:50发布

问题:

i'm new to android and i have a problem with this in the picture :

i tired to update constraint layout and constraint layout solver but each time i try to update in sdk manager update finish successfully but when i look at sdk manager again it's unchecked . for example after downloading constraint layout and constraint layout solver successfully :

but when i look at the android sdk path in the finder there is 4 version of constraint Layout installed : 1.0.0alpha7
1.0.0alpha2
1.0.1
1.0.2

i downloaded gradle 2.14 and copy and replace unzipped file with the default gradle 3.3 installed by android studio but ... no change !

can anyone plz help . i spend 5 hours on this and nothing changed

回答1:

As indicated in the error message, the problem is with the AppCompat support library, not the ConstraintLayout library. Specify a particular version or add an * after the major version code, like so:

compile 'com.android.support:appcompat-v7:25.3.1'

or

compile 'com.android.support:appcompat-v7:25.*'



回答2:

Click on this text:

and then press Right Alt + Enter (shortcut for quick fixes) -> Select the first suggestion which should state something like Change version to...25.x.x.

This will ensure that you will be using the newest version.