Fixed
Status Update
Comments
d....@gmail.com <d....@gmail.com> #2
I am getting the same problem after the latest update...
am...@google.com <am...@google.com> #3
I think this might be the same as issue 36949180 . As mentioned in the comments there, try:
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
an...@gmail.com <an...@gmail.com> #4
Deleting the out folder before rebuilding solves the problem
am...@google.com <am...@google.com> #5
turning off Preferences > Compiler > Use External Build doesn't work if you have other modules as dependencies.
d....@gmail.com <d....@gmail.com> #6
I'm having the same problem.
d....@gmail.com <d....@gmail.com> #7
Same issue here
am...@google.com <am...@google.com> #8
Also having this problem, but turning off Preferences > Compiler > Use External Build worked for me, even though I have other modules as dependencies, despite what jai.chan mentioned.
d....@gmail.com <d....@gmail.com> #9
[Comment deleted]
do...@gmail.com <do...@gmail.com> #10
Problem exists. Turning off "Use external build" helps.
gi...@gmail.com <gi...@gmail.com> #11
Also having the same problem.But I don't know How can I fix ?
tw...@gmail.com <tw...@gmail.com> #12
The problem is still there... :s
mr...@gmail.com <mr...@gmail.com> #13
having the same issue here too
[Deleted User] <[Deleted User]> #14
Still happens
[Deleted User] <[Deleted User]> #15
A shame that google is not able to solve this issue since several years but is able to pop out yet another android version.
[Deleted User] <[Deleted User]> #16
Android Studio 1.4 and this or similar bug is still here! My project is completely blocked due to inability to add a new activity class without getting "cannot find symbol" for it. The other classes are getting compiled except that activty. I've checked in the build/intermediates/classes - the activity .class is missing, not even compiled though it is hollow class, no syntax error.
Already tried:
Invalidate Cache and Restart - nope
Deleted /build directory and rebuild - nope
./gradlew clean of entire project - nope
Restarting after everything above - nope
Recreating a new blank activity - nope
Checked manifest entries for the activity - nope
Combination of the above - nope
Desperation mode: on
Already tried:
Invalidate Cache and Restart - nope
Deleted /build directory and rebuild - nope
./gradlew clean of entire project - nope
Restarting after everything above - nope
Recreating a new blank activity - nope
Checked manifest entries for the activity - nope
Combination of the above - nope
Desperation mode: on
[Deleted User] <[Deleted User]> #17
I've just managed to workaround it! Simple Refactor > Move to another package did remove the error, but after I moved it back to the original package the error appeared again. Have NO idea what's going on!
Description
Version used: 25.1.0
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: every devices I tested on, for example : Sony Xperia Z3 tablet, Samsung Galaxy Tab S2.
It seems related to other issues being reported about fragment replace transactions, but this one does not use the replace method.
Steps to reproduce :
- Add a fragment with a simple transaction :
getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.add(R.id.fragment_container, new TestFragment())
.commit()
- Remove the fragment using a simple remove, and just after start a new activity :
final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (fragment != null) {
getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.remove(fragment)
.commit();
startActivity(new Intent(this, MainActivity.class));
}
- Go back to the old activity
What should happen : the fragment that was added should not be here anymore.
What happens : the fragment is still here. But the thing is it's only some sort of "ghost view" : it's impossible to reach it in debug using the view hierarchy. I even tried to activate the debug option "show layout bounds", which does not shows the bound on the fragment view. The view is not clickable, if I call removeAllViews() on the container it's still here.
Another thing : even with this view still here, if I re-add a fragment it will be added below the "ghost view". Everything works, but the old view is still here.
I attached a sample project to reproduce this issue. The "remove fragment" button is just here to validate the behaviour without starting another activity. You can see the bug using :
- "Add fragment"
- "Remove fragment and start activity"
- Press the back button
The old fragment is still here. If you press the add fragment button, another fragment will appear behing the old fragment, which should not be possible.
If you use the "show layout bounds" option, the bug is really visible :
- Start from scratch (kill the app)
- "Add fragment"
- Enable the "show layout bounds" option.
- "Remove fragment and start activity"
- Press the back button
Here everything seems normal except for the fragment still being here. But if you disable the "show layout bounds" option, the fragment view will stay unchanged, with layout bounds displayed. As if it were a cached view not recognized by the system.
I also attached a screenshot of this behavior. You can see the "show layout bounds" option is disabled, but it still shows on the fragment view.
All this does not happen with support lib 25.0.1.