Reputation: 8082
I today updated sdk as studio suggest, after that in such code
import android.app.Fragment;
public class TaskFragment extends Fragment {
it show Fragment
in red, and show hint Cannot resolve symbol 'Fragment'
,
but Build->Make Project
without problem,
how can I fix this issue?
.AndroidStudio2.3/system/log/idea.log
rather big,
so I post only error:
ERROR - aemon.impl.PassExecutorService - Accessing invalid virtual file: file:///home/xxx/Android/Sdk/sources/android-25; original:101; found:-
com.intellij.openapi.vfs.InvalidVirtualFileAccessException: Accessing invalid virtual file: file:///home/xxx/Android/Sdk/sources/android-25; original:101; found:-
directory /home/xxx/Android/Sdk/sources/android-25
exists
Upvotes: 1
Views: 2155
Reputation: 8082
Thanks to @abhishek I find root of problem - /home/xxx/Android/Sdk/sources/android-25
, so I removed SDK Platfrom -> Android 7.1.1 and installed it again.
And now Android IDE again can found Fragment
.
Upvotes: 0
Reputation: 1221
Following points may help you to solve this error.
File -> Invalidate Caches...
, and select "Invalidate and Restart" option to fix this and then rebuild
project again.Make sure that your build.gradle
file has:
dependencies {
compile "com.android.support:support-core-utils:25.4.0"
}
SDK
.Sync Project with Gradle
Files button in the toolbar.Upvotes: 2
Reputation: 69
Check SDK location is OK or not.
File >> Project Structure >> SDK Location >> C:\Users\You PC Name\AppData\Local\Android\Sdk
Upvotes: 2