I am having difficulty importing a project written on Android Studio 1.1 into Android Studio 2.1.2. I keep getting this error whenever the gradle is building before testing
Turning off the instant run(File >>Settings >>Build,Execution,Deployment >> Instant Run), solved my issue
Clean and Rebuild is working fine for this problem and it is good also than other solutions.
You can clean your project with gradle wrapper of your project. In linux:
$./gradlew clean
In windows:
>gradlew.bat clean
mi users if you are facing this type of issue follow these steps:
Step 1 : generate developer options as follow Settings>>About Device>>Click 7 times on MIUI Version>> It will Generate Developer Options.
Now Enable Following...
Step 2: Setting>Additional setting> Developer options> Enable USB Debugging
Step 3: Setting>Additional setting> Developer options> Enable Install via USB Note: Its Will get Enable Only If You Insert SIM In MI Device/Phone.
Step 4: Setting>Additional setting> Developer options> Enable Verify apps over USB.
all done now run the project and test....
non mi user:
just enable once instant run options from the settings--> Build,Execution, Deployment-->Select Instant Run and Enable Check Click On OK...
Its Will Work....
Trying cleaning AND rebuilding your project: In Android Studio, open up the Build tab at the top left and try both the Clean and Rebuild options.
In my case, going to Settings>Build, Execution, Development>Compiler>Command-line options and removing the --dry-run
flag fixed it for me. Not sure why that was there in the first place, but it solved it for me.