I'm having some strange issue with Android Studio
recently. I'm trying to build a project after few modification in code. But the APK
got installed is of old code. (I found this by debugging
. When I debugged
it was going to empty lines) But all my latest code are saved and it's there. I have tried the following steps which I know.
Delete the build folders of Project and Module manually > Restart Studio > Clean Project > Rebuild Project
Restart Android Studio
and (I don't know why I restarted but I did that too)Invalidate and Cache Restart
- At some point I found a issue in
XML
related tostyle
attribute for button which was like style:attr/buttonBarButtonStyle I later corrected to style:"?android:attr/buttonBarButtonStyle"I hope this change is correct because it don't show any more error. - And finally it doesn't give me any error in stacktrace. Project always shows BUILD SUCCESSFUL
Nothing above helped me.
EDIT 1 : I have updated my Android Support Library
to 22.1.1
latest version which released a couple of days ago
EDIT 2 : I uninstalled Android Studio
. Deleted Android Studio
related folders in C:\Program Files\Android\Android Studio
and also deleted C:\Users\MyUserName\.android & .AndroidStudio & .gradle
folders. And did fresh install of Android Studio
. Later I imported a same project and build it. Again it happens in same way! I have also tried running the same project in other lap and it runs without any problem. I Don't know what else I'm missing here
EDIT 3 : Updating my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
signingConfigs {
debug {
storeFile file("./debugkeystore/MyAppDebug.keystore")
}
}
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:6.1.+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:cardview-v7:21.0.+'
}