udacity / Android_Me

App that lets you style your own Android! This uses Fragments to create a flexible and responsive UI.
259 stars 1k forks source link

Gradle Issue #71

Open AyushKoul00 opened 4 years ago

AyushKoul00 commented 4 years ago

I am using the latest version of Android Studio and for some reason, it shows me errors on the build.gradle file right when I import it. The First error is on the targetSdkVersion which is by default 25. The error says Google Play requires it to be 26 or higher (so I changed this to 26) The second error is with the android support library. When I fix it and sync the gradle file, I get this error: ERROR: Failed to resolve: com.android.support.test.espresso:espresso-core:2.2.2 Add Google Maven repository and sync project Show in Project Structure dialog Affected Modules: app

This is the code for my build.gradle file currently: `apply plugin: 'com.android.application'

android { compileSdkVersion 26 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.example.android.android_me" minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.1.0' testCompile 'junit:junit:4.12' } `

LaszloLajosT commented 4 years ago

Hi,

Do whatever suggest your Android Studio. For example:

Add Google Maven repository and sync project Show in Project Structure dialog Affected Modules: app

Also, it is a good start if you double check which platform you already installed ( open Android SDK Manager in Android Studio) and change your target SDK to that. screenshot of Android SDK manager