0

I have a weird problem with Android Studio. When I Run my app there are no gradlebuild and etc. just installing app and launch activity which means nothing what I changed in the code will be changed in my apk.

Have you any idea why is this happening?

project level gradle:

buildscript {
ext.kotlin_version = '1.2.30'
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
    classpath 'com.google.gms:google-services:3.2.0'
    classpath "io.realm:realm-gradle-plugin:5.0.0"
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    google()
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

app level gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' 
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'

android {
compileSdkVersion 26
defaultConfig {
    applicationId ""
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
realm {
    syncEnabled = true;
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
}
apply plugin: 'com.google.gms.google-services'
ahajib
  • 12,838
  • 29
  • 79
  • 120
J.Doe
  • 147
  • 1
  • 14

4 Answers4

4

You have to fix the Run process in Android Studio.

Look at your main toolbar and find this box: enter image description here

Click the box and select Edit Configurations....

Make sure the window has the following items in Before launch section:

  • Gradle-aware Make
  • Instant App Provision

enter image description here

Click OK.

Run your app.

Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124
0

Try to following instruction it will surely help you. I already face same problem before couple of month.


* Update ADB in your Android Studio.
* Uninstall application.
* Restart adb start-server.
* Restart you testing device.

RKRK
  • 1,284
  • 5
  • 14
  • 18
Nitin Sharma
  • 100
  • 9
0

Try this: File menu -> Invalidate Caches/ Restart. I think it will resolve your problem.

immodi
  • 607
  • 1
  • 6
  • 21
0

There's been an issue in the 3.1.0 build tools upgrade of Android Studio. Follow these steps to resolve it.

  1. Select Run and click Edit Configurations

    Make sure, Gradle-aware Make is Added in TaskList or not. If not then:

  2. click +

  3. select Gradle-aware Make
  4. Leave the task empty and select OK

NOTE: Make sure Gradle-aware Make is before Instant App Provision

Deep Lathia
  • 750
  • 7
  • 18