Android Studio 3.1 "Run" Not Compiling Code

Android Studio 3.1 Run not compiling code

I have solution for your issue.

Also confirmed by Android Studio on Twitter : https://twitter.com/androidstudio/status/981914632892960768

  1. Edit your app configuration as below.

Sample Image


  1. Here you can see your app configuration as below.

Sample Image


  1. Here is missing Gradle-aware make attribute in before launch configuration. You can see here.

Sample Image


  1. Please add this Gradle-aware Make attribute through this way. Click on + icon and select Gradle-aware Make as seen in this screen.

Sample Image


  1. You can add this without writing any task just press OK button and task will be added and now it should look like this. Now apply changes and run your application.

Sample Image

It will solve this old apk installing issue on clean build in new Android Studio 3.1 issue.

Note : This issue is resolved in new Android Studio 3.1.1 Stable release.

Android studio 3.1 run command does not rebuild the APK

Go to Run -> Edit configurations. And then make sure you have Gradle-aware Make option like below screenshot.

Sample Image

If not then click + and select from the

More update in twitter regarding this:https://twitter.com/androidstudio/status/981914632892960768

Android Studio 4.1.1 “Run” not compiling code

You need to Enable instant app support for that.
In the toolbar menu of Android studio, go to Refactor -> Select Enable Instant Apps Support option -> select the desired module and click OK.
This will add the below line in Manifest file:

<dist:module dist:instant="true" />

Once done, edit Run configurations and there you will find checkbox of Deploy as Instant app in Installation options section, enable it, and then run the app on the device, you will find the Instant app running on your device.

Note: Please uninstall the previous version of app if any.

For step by step guide, follow below reference before following above steps, there is also dependency that needs to be added.

Reference:

Google Instant App Guide

Android studio update (3.1.1) and now app won't run

The task that is failing is:
:app:transformDexWithInstantRunDependenciesApkForDebug

Try turning off Instant Run:

  1. Open the Settings or Preferences dialog: On Windows or Linux,
    select File > Settings from the menu bar. On Mac OSX, select Android
    Studio > Preferences from the menu bar.
  2. Navigate to Build, Execution, Deployment > Instant Run.
  3. Uncheck the box next to Restart activity on code changes.
  4. Re-build.

This is Google issue 72811718 a bug in AS 3.1+

Android Studio 3.1 not showing build error details

There is a toggle button just below the build button that will show the verbose build logs. Tap that and you should be able to see errors like before AS 3.1.

toggle button

Error building project with Android Studio 3.1 and build:gradle 3.1.0

I found the solution finally.

I used findViewbByiId for each view defined in the layout file to get reference from the XML.

But in Android Studio 3.1 no need use this anymore.

I simply remove all findViewbByiId code where i place to get reference from XML widgets, now error has gone.!



Related Topics



Leave a reply



Submit