Android Studio "cannot resolve symbol String"

There is simpler and I think more correct way:

Just select menu item 'File/Invalidate Caches/Restart...'

For me this successfully resolved the issue (was caused by surprising power off of PC)

enter image description here


So project arrangement should be as follows:

  • create app folder within your project.
  • within app folder make following folders: libs and src
  • inside src create main folder
  • inside main create java and assets
  • move contents of old src to java
  • move contents of old libs to libs
  • move res folder to src
  • move AndroidManifest.xml to src
  • move assets folder into src
  • create build.gradle inside app folder with following content:
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
}
  • create settings.gradle in project root with following content:

include 'app'

  • build.gradle in root should have following structure:

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