in my project after moving it from one pc to another via usb I started getting errors in every file on almost every line, but the app can still be built and run on an emulator.
From what I can tell android studio is having trouble finding the support-v7 library to import all the files
This is from my main activity:
import android.support.design.widget.NavigationView import android.support.design.widget.Snackbar import android.support.v4.view.GravityCompat import android.support.v7.app.ActionBarDrawerToggle import android.support.v7.app.AppCompatActivity import android.support.v7.widget.DefaultItemAnimator import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView And the error message I'm getting is:
Unresolved reference: widget
This is my project level gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.2.61' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:4.0.2' } } allprojects { repositories { google() jcenter() mavenCentral() } } task clean(type: Delete) { delete rootProject.buildDir } And this is my app gradle file:
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 27 defaultConfig { applicationId "com.example.test" minSdkVersion 19 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' implementation 'com.google.firebase:firebase-messaging:17.3.1' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'org.jsoup:jsoup:1.11.3' implementation 'com.github.bumptech.glide:volley-integration:4.8.0' implementation 'com.github.d-max:spots-dialog:1.1@aar' implementation 'com.github.bumptech.glide:glide:4.8.0' implementation 'com.google.firebase:firebase-core:16.0.3' implementation 'com.android.support:cardview-v7:27.1.1' implementation 'android.arch.paging:runtime:1.0.1' implementation 'com.android.support:support-vector-drawable:27.1.1' implementation 'com.android.support:support-v4:27.1.1' implementation 'com.android.support:recyclerview-v7:27.1.1' } apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-android-extensions' You can also see from this image
that the intelli sens is throwing all kinds of errors, but if I run the it will launch and work perfectly in the emulator or on my device.
And this is from running gradle sync:
What I have tried so far:
- Re synced gradle by changing the app version code
- Build -> clean project
- Build -> rebuild project
- File -> invalidate cache / restart
- File -> sync project with gradle files

apply plugin: 'kotlin-android-extensions'in your app gradle file? Please remove one and check again.