I am developing android applications and I am using Android Studio.
There is a problem though. When I change the source and I run the app it works fine, But when I change a resource it does not change until I do a Clean Project. e.g. I add a button and run the app, the button does not exist but when I do a clean project it is there. Android studio shows an error when accessing the id
of the newly added view.
Please help me solve this problem. Any help would be much appreciated.
Additional information: -Android Studio version: 1.3.1 -Operating system: windows -Gradle version: 2.6
EDIT:
I am having multiple directories as my resources with gradle like this:
sourceSets{
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
res.srcDirs = [
'src/main/res',
'src/main/res/layouts/test',
'src/main/res/layouts/login',
'src/main/res/layouts/main',
'src/main/res/layouts/includes'
]
}
}
When i try to run the project with changed layout it says:
No apk changes detected. Skipping file upload, force stopping package instead.
DEVICE SHELL COMMAND: am force-stop com.my.package
Android studio shows an error when accessing the id of the newly added view
... And the error is? – Phantômaxx