Android的Studio项目建设问题 [英] Android Studio project build issue
问题描述
我在与一些奇怪的问题,Android的工作室
最近。我试图建立code少修改后的项目。但 APK
安装得到了老code的。 (我发现这个通过调试
。当我调试
这是将空行),但我所有的最新code的保存,它的存在。我曾尝试以下步骤,我知道了。
-
手动&GT删除项目和模块的构建文件夹;重新启动工作室>清理项目>重建工程
-
重新启动Android的工作室
键,(我不知道为什么我重新启动,但我没有太) -
废止和缓存重新启动
- 在某些时候,我发现了一个问题,
XML
相关的按钮,这就像风格风格
属性:ATTR / buttonBarButtonStyle我后来更正为风格:机器人:ATTR / buttonBarButtonStyle我希望,因为它不显示任何错误这种变化是正确 - 最后它没有给我任何错误堆栈跟踪。项目总显示 BUILD SUCCESSFUL
上面没有什么帮助了我。
编辑1:我已经更新了我的 Android的支持库
到 22.1.1
其发布的前两天
编辑2:我卸载 Android的工作室
。删除 Android的工作室
在相关文件夹C:\\ Program Files文件\\的Android \\ Android的工作室
,并删除 C:\\用户\\ MyUserName输入\\ .android&安培; .AndroidStudio&安培; .gradle
文件夹。并没有新的安装 Android的工作室
的。后来我进口相同的项目,并构建它。它再次发生在同样的方式!我也试图运行在其他圈在同一个项目,它运行没有任何问题。 我不知道我错过些什么这里
修改3:更新我的build.gradle
应用插件:'com.android.application安卓{
compileSdkVersion 22
buildToolsVersion22.0.0signingConfigs {
调试{
storeFile文件(./ debugkeystore / MyAppDebug.keystore)
}
}
defaultConfig {
的applicationIDcom.example.myapp
14的minSdkVersion
targetSdkVersion 22
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}
依赖{
编译文件树(导演:'库',包括:['的* .jar'])
编译com.android.support:appcompat-v7:22.0.0
编译com.google.android.gms:播放服务:6.1 +。
编译com.android.support:recyclerview-v7:+
编译com.android.support:support-v4:22.0.+
编译com.android.support:cardview-v7:21.0.+
}
我只是再次卸载 AndroidStudio
并清除系统登录,并使它像一个全新安装第3次我不知道如何,但是这一次它的工作!但并没有得到究竟发生了什么!
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.+'
}
I just again uninstalled AndroidStudio
and clear the registery and made it like a fresh install for the 3rd time and I don't know how but this time it worked! But didn't get what exactly happened!
这篇关于Android的Studio项目建设问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!