Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDEA does not always deploy latest changes

I tried to run both the android app and the compose for desktop app in one folder, but I ran into some problems.

MyProject
│   │└──android
│   │     │ └── app
│   │     │   └──build.gradle.kts
│   │     └── build.gradle.kts
│   └── desktop
│       └── build.gradle.kts
└── settings.gradle.kts

settings.gradle.kts

pluginManagement {
  repositories {
    google()
    gradlePluginPortal()
    mavenCentral()
    maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
  }
  plugins {
    kotlin("multiplatform").version("1.7.10")
    id("org.jetbrains.compose").version("1.2.0")
  }
}

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
  }
}

rootProject.name = "MyProject"
include("android:app")
include("desktop")

My Android app has a single module architecture, but when I run android.app in IDEA, it tries to install the apk directly on my emulator/phone without going through the building stage. If I delete the app-debug.apk in the build folder and run it again, it will not be able to install the apk.

IDEA: IntelliJ IDEA 2022.3.2 (Ultimate Edition)
AGP: 7.3.0
gradle: 7.5.1


02/06: Launching 'android.app' on <default>.
Error loading build artifacts from: C:\Users\...\android\app\build\intermediates\apk_ide_redirect_file\debug\redirect.txt

Just like the error above, IDEA seems to be forever trying to install the cached apk instead of building the latest apk

like image 763
Afterglow Avatar asked Oct 31 '25 04:10

Afterglow


1 Answers

what worked for me is this :

Create a new configuration for Run with the same parameters as the default config app

Run && 
Edit Configuration  &&
Add New Configuration && 
Rename && 
Choose app Module && 
Apply && 
Run app normally from Run Button android studio 
like image 85
Aslm Monir Avatar answered Nov 01 '25 18:11

Aslm Monir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!