Issue 1: In MainActivity.java I get a syntax error 'cannot resolve symbol R'.
Issue 2: When I try to clean or rebuild the project I get a very long error linked here
It is also worth noting that I can still run the app and have it deployed to my phone. Just the option to build the app fails.
I have tried a few things including
deleting .gradle and .idea/libraries.
adding the following line
implementation 'com.android.support:support-annotations:26.1.0'
Make a project and make an app
Here are my app and MyApp Gradle files.
App Level:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "engineer.myname.myapp.myapp"
minSdkVersion 22
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.3'
implementation 'com.android.support:support-annotations:26.1.0'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Project Level:
// 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.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}