Error:Failed to resolve: runtime

  • A+
Category:Languages

so my project was working fine yesterday and I tried to open it today and it gives me that error , help would be much appreciated I tried to search for a long time about whats going wrong but it seems all answers not working with me

Error:Failed to resolve: runtime Open File

here is build.gradle(Project) file:

   // Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {      repositories {         google()         jcenter()      }     dependencies {         classpath 'com.android.tools.build:gradle:3.0.1'         classpath 'com.google.gms:google-services:3.2.0'           // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } }  allprojects {     repositories {         jcenter()         maven {             url "https://maven.google.com" // Google's Maven repository         }     } }  task clean(type: Delete) {     delete rootProject.buildDir } 

and here is build app profile

apply plugin: 'com.android.application'  android {     compileSdkVersion 26     defaultConfig {         applicationId "com.example.android.writer"         minSdkVersion 15         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 {     implementation fileTree(dir: 'libs', include: ['*.jar'])     implementation 'com.android.support:appcompat-v7:26.1.0'     implementation 'com.android.support.constraint:constraint-layout:1.1.0'     implementation 'com.google.firebase:firebase-database:11.0.4'     implementation 'com.google.firebase:firebase-auth:11.0.4'     testImplementation 'junit:junit:4.12'     androidTestImplementation 'com.android.support.test:runner:1.0.1'     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'     implementation 'com.rengwuxian.materialedittext:library:2.1.4'     implementation 'com.android.support:design:26.1.0'     implementation 'com.github.clans:fab:1.6.4'     implementation 'com.android.support:cardview-v7:26.1.0'     implementation 'com.firebase:firebase-client-android:2.5.2+' }   apply plugin: 'com.google.gms.google-services' 

 


Based on the answer in Android Studio 3.1.2 : Failed to resolve: runtime, try changing the order of imports in build.gradle project file as

allprojects {     repositories {         google()         maven {             url "https://maven.google.com" // Google's Maven repository         }         jcenter()      } } 

This worked for me.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: