0

After downloading and installing the API 24 source code, I am seeing a large number of compiler errors in classes that have changes in API 24.

For example, the AccessibilityService class has hundreds of "Cannot resolve symbol" errors on variables, methods, imports etc.

I have tried deleting and redownloading sources multiple times to no avail. Is this a common occurrence with a new set of sources or did I do something wrong?

Edit:

Here is my app Gradle file, and I am using 'com.android.tools.build:gradle:2.1.0' apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.nyelito.dactyl"
    minSdkVersion 23
    targetSdkVersion 24
    versionCode 10
    versionName "1.2.2"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile(
        [group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.4.1'],
)
provided 'org.glassfish:javax.annotation:10.0-b28'
compile('com.mikepenz:aboutlibraries:5.6.7@aar') {
    transitive = true
}


compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.github.medyo:android-about-page:1.0.5'
compile 'com.github.thepacific:adapter:1.0.5'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.github.paolorotolo:appintro:4.0.0'
}

apply plugin: 'com.google.gms.google-services'

Here is a screenshot of what it looks like

Nick Yelito
  • 77
  • 1
  • 10

2 Answers2

0

When you change compileSdkVersion, you also need to change buildToolsVersion to something compatible. In this case

buildToolsVersion 24.0.2
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • I think this is necessary, but I am still seeing the errors after making the change as well as the change suggested by @LongRanger below. `android { compileSdkVersion 24 buildToolsVersion "24.0.2" defaultConfig { applicationId "com.nyelito.dactyl" minSdkVersion 23 targetSdkVersion 24 ... jackOptions { enabled true } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ` – Nick Yelito Sep 01 '16 at 03:40
  • Does the error still be "AccessibilityService class has hundreds of "Cannot resolve symbol" errors on variables, methods, imports etc."? – Long Ranger Sep 01 '16 at 08:34
0

@Code-Apprentice is right, you need to change buildToolsVersion with the major version number compatible with your compiled sdk version.

'android-24' requires JDK 1.8 or later to compile

https://developer.android.com/guide/platform/j8-jack.html

Also, I found you compiled with API 24, which needs JDK8. Please adds the following in your build.gradle

android {
  ...
  defaultConfig {
    ...
    jackOptions {
      enabled true
    }
  }
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}
Community
  • 1
  • 1
Long Ranger
  • 5,888
  • 8
  • 43
  • 72