简体   繁体   English

Android Studio不会在构建时更新我的​​应用

[英]Android studio wont update my app on build

So when i add an new theme or add code etc it does not update the app, like if i add a button, and click run it will run and open a older version on the app. 因此,当我添加新主题或添加代码等时,它不会更新应用程序,例如如果我添加按钮,然后单击“运行”,它将运行并在应用程序上打开旧版本。 i have tried to rebuild, i have tried to re install, like a totally clean uninstall and reinstall on the app, make sure the run instance is ok and practically everything, even the edit config. 我尝试重建,我尝试重新安装,例如完全干净的卸载并重新安装在应用程序上,请确保运行实例正常,并且几乎所有内容,甚至是编辑配置。 I reinstalled android studio but still have the same issue. 我重新安装了android studio,但仍然遇到相同的问题。

Activity main: 活动主体:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/background"
tools:context="dogboy602k.com.myapplication.MainActivity">


<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Login to your account"
    android:id="@+id/textViewHello"
    android:textColor="#100606"
    android:textSize="@dimen/abc_action_bar_icon_vertical_padding_material"
    android:background="#00ffffff"
    android:layout_above="@+id/emailField"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="65dp" />

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textPassword"
    android:ems="10"
    android:id="@+id/passwordField"
    android:text="Password"
    android:layout_marginBottom="72dp"
    android:background="#00ffffff"
    android:layout_above="@+id/button"
    android:layout_alignParentStart="true"
    android:layout_alignEnd="@+id/emailField" />

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textEmailAddress"
    android:ems="10"
    android:id="@+id/emailField"
    android:text="Email"
    android:autoText="false"
    android:background="#00ffffff"
    android:layout_marginBottom="40dp"
    android:layout_above="@+id/passwordField"
    android:layout_alignParentStart="true"
    android:layout_alignParentEnd="true" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Enter"
    android:id="@+id/button"
    android:textColor="#000000"
    android:background="#dedddd"
    android:nestedScrollingEnabled="false"
    android:onClick="clickFunction"
    android:layout_marginBottom="51dp"
    android:minWidth="80dp"
    android:minHeight="50dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" />
  </RelativeLayout>

build gradle: 建立gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
    applicationId "dogboy602k.com.myapplication"
    minSdkVersion 19
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.firebase:firebase-client-android:2.3.1'
}
apply plugin: 'com.google.gms.google-services'

instant run settings 即时运行设置

edit config 编辑配置

Click here, refresh all your projects: 单击此处,刷新所有项目:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM