1

enter image description here

This started happening once I imported jcodec (http://jcodec.org/) for Android into the Studio as a module. The actual project itself compiles fine and works as expected on both devices and emulators but the compiler marks everything involving non-custom libraries as errors. Operations involving custom classes within the project does not have the compiler errors.

I tried the following: 1) Invalidate/Cache restart 2) Deleted the .idea folder and .iml files and reimported the whole project 3) Added the library via Project Structure and Synced Project with Gradle files

The worst part is that this inline compiler error happens for all projects in Android Studio (new and old) now. I am using Android Studio version 0.5.4.

Is there anything I can do to fix this? Does it have anything to do with jcodec?

jcodec build.gradle files


buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}
apply plugin: 'android-library'
android {
    compileSdkVersion 16
    buildToolsVersion '19.0.3'

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 16
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
}

main project build.gradle


buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 16
    buildToolsVersion '19.0.3'

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 16
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:19.1.0'
    compile 'com.android.support:support-v4:19.1.0'
    compile files('libs/android-async-http-1.4.4.jar')
    compile project(':jcodec')
}


  • Can you give some examples of the sorts of errors you're seeing and what parts are okay? – Scott Barta Apr 15 '14 at 16:09
  • I have attached an image with the import file statements that shows unresolved symbol errors. The project runs fine, its just the IDE showing errors for no reason. – ExtremelyPoorMan Apr 15 '14 at 16:52
  • Hmm, that's definitely weird. What's the actual error it reports on those lines? – Scott Barta Apr 15 '14 at 17:04
  • 1
    The project shows unimported Classes. Check Module settings for Android SDK and Java. try restarting the IDE. – mipreamble Apr 15 '14 at 17:10
  • @ScottBarta The error being shown at the line -> import java.io.File is cannot resolve symbol 'File' (Similar errors for all other import statements) – ExtremelyPoorMan Apr 15 '14 at 17:28
  • @mipreamble There was some disparity between the module settings and the build.gradle files for the main project and the library... but modifying them to match each other and restarting the IDE didnt remove this issue either... I have attached the build.gradle files for my jcodec library and my actual project to the question in case that might help – ExtremelyPoorMan Apr 15 '14 at 17:39
  • The problem seems to be that the IDE side of things doesn't see your android SDK library properly (though Gradle builds it). The only idea I have is to make sure everything is updated in the SDK manager, and perhaps set your compileSdkVersion to 19 all around if you can. If that doesn't help, I'm not sure what to suggest. – Scott Barta Apr 15 '14 at 17:42
  • @ScottBarta Updating the compileSdkVersion to 19 didnt seem to have an effect. Thanks for your help though. – ExtremelyPoorMan Apr 15 '14 at 17:52
  • @mipreamble is correct... I reinstalled Android Studio and then modified the module settings for Android SDK and Java... for some reason the setting isnt saved and I have to modify it each time I boot into the IDE but it works now... If you can submit it as an answer I can accept it. Thanks – ExtremelyPoorMan Apr 15 '14 at 19:57
  • Android has so many unreliable things like this :/ – coolcool1994 Jul 09 '14 at 03:07
  • I know it is an old thread, but rebuilding the project fixed the problem for me, android studio --> Build --> Rebuild Project – solidfox Aug 14 '16 at 18:25

0 Answers0