I tried creating an Android app. using tabs in Android Studio. I ran into the issue where all my fragment imports were causing the error Cannot Resolve Symbol 'FragmentManager'
, and anything else associated with fragments within my program. I made sure I was importing the correct support files:
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
I checked to make sure I was calling active fragments in my layout files, similar issue explained [here].
I made sure I had the latest Android SDK Build-tools, shown [here].
I [re-synced the Gradle Files].
Tools > Android > Sync Project with Gradle Files
I even imported a pre-made application from the Android Developer guides, [Creating Swipe Views with Tabs], and the error was not going away. Which made me think that there was possibly something wrong with Android Studio. I recently updated to Version 0.8.14 and I noticed the file structure changed a bit, it is now more streamlined.
Which lead me back to poke around within the gradle files. I opened up the build.gradle and verified that there were no issues from the minSdk version and then did one last check on possible errors with Gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 15
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "app.name"
minSdkVersion 15
targetSdkVersion 15
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Check out my answer for the [solution].