I tried to build the APK file for my project. It created a file in the build folder. After that I am not able to test my app further as the new project after any changes is not getting installed in my device now. I tried most of the solutions given on the internet. The project is built successfully but it just doesn't get installed. The installation goes on forever. And then an error message pops up like the one given in the image. It is a screenshot of the error message.
I have tried cleaning and rebuilding and then running the app. It didn't worked. I deleted the build folder. It didn't helped.
Try to run off Instant Run Settings -> Build, Execturion, Depoyment -> Instant Run, disable there.
i got the solution. The app was not properly uninstalled. It was not showing in the app drawer but it was there when I opened the Application Manager from my phone's Settings. From there, I uninstalled the app and then reinstalled it from /android Studio and it worked fine.
Related
Im trying to generate an APK to test my android build, it used to work before, i dont know what went wrong that it stopped working, whenever i try to run on device either on android studio or my own device, it does not build even though its error clean. App actually installs, but when its about to run it closes down and this message appears
Heres what i got from checking the logcat on Android Studio: https://imgur.com/a/FdE4WMo
Try uninstalling the app from the device and then run it again.
The dev / debug build uses an encryption key that's specific to the machine so I think that maybe you are trying to install a different app over the original one?
Seems my Android studios isn't working as it used to work before.
When I run the emulator, it loads for a bit of time, later it opens the emulator, but the project isn't loading up. I'm receiving strange type of error:
Installation failed with message Invalid File: C:\google-services-master\android...\app\build\intermediates\split-apk\debug\slices\slice_2.apk.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
I had some thoughs maybe the project is broken, so I made a new one. The same problem occurs, I created a new emulator, didn't helped either, rebuilded and cleaned the project and still receiving the same problem.
I've checked these topics:
Installation failed in android studio
Android Studio: Application Installation Failed
Couldn't fix it either.. Idk, maybe I should reinstall Android Studios? But hell yeah, it takes so long to install all the updates..
P.S. The project consumes only 1 layout and 1 imageview.
Everything was working fine until now..
I had installed Android Studio few months back. It was working fine till yesterday. Windows made some automatic update. Then, I started getting an error if I try to start Android Studio:
Config path'C:\Program Files(x86)\Android\android-studio\config' is invalid.
If you have modified the 'idea.config.path' property please make sure it is correct,
otherwise please re-install the IDE.
I searched on Stack Overflow and found some suggestions which had helped others - enter link description here
But this is not helping me. In my copy of the file C:\Program Files\Android\android-studio\bin\idea.properties, the lines
#idea.config.path=${user.home}/.AndroidStudioPreview/config
#idea.system.path=${user.home}/.AndroidStudioPreview/system
were missing. (I have copied these here from the other link with answers).
I have tried
Uninstall the installation and reinstall it
Running Android Studio as administrator
Manually opening the idea.properties file as administrator, adding
the 2 lines for config and system, then saving file and restarting
Android Studio.
But the same error persists. Can anyone help me to resolve this?
I uninstalled once more. Then, again ran the installation with "run as administrator" privilege. After this, if I start Android studio with "run as administrator" privilege, then it starts up. If I run it normally (non-administrator) it still runs into the same error.
I just opened a new Android project thorugh eclipse, I want the application to run on my samsung galaxy s4 which has KitKat 4.4.2 on it, so I opened the project so as Target SDK is 5.0.1 and the compilation will be done with 4.4.2, just when the project opens I get errors, i fixed it by accesing both appcompat and the projects project.properties and changing the target to apk-21. the errors vanish. But ! when I try to debug with my phone or with the emulator it fails, - Installation error: Unknown failure - thats the error, as I looked through the web I saw many people that get through this problem and non of the solutions was posted solved my problem. I will be really glad if someone could help me solve this annoying thing. Thank! !
I had the similar kind of issue and I have resolved the issue following the steps below:
File >> Settings >> Build, Execution, Deployment.
Next click on Instant Run and uncheck "Enable Instant Run to hot swap code/resource changes on deploy".
Apply and OK.
Try building the app again now. It should work now. Enable the Instant Run feature again if you want to.
We had a similar issue in Android Nougat.
Reason happened to be renaming the Project Folder.
Build -> Clean Project
Build -> Rebuild Project
Try this out in case you have altered anything related to Project Structure or Gradle Settings.
It happened for me also. Try to unplug your device and reconnect again. Once done, run adb devices in your command prompt to see if the device is detected successfully.
If yes, then clean and run the project. This worked for me. Give it a try.
Second Option
Try to delete your debug certificate and then restart the eclipse. Do Project clean - build and run the application
Debug certificate path depends on platforms. Find it in
Preferences - Android - Build - Default debug keystore.
I recently switched from Eclipse to Android Studio because I read that it is now the official IDE for Android application development. I downloaded and installed the latest version (1.0.2) for Windows. When using the program for the first time, I decided to create a test application to see if the program was working correctly. Unfortunately, it was not. Once I clicked the finish button to complete the New Project Wizard, A loading bar showed up that said Gradle: Build. This is where the program gets stuck. There is no error message and it appears that the program is running fine, however the build never actually completes. I am never given my MainActivity.Java class, or my activitymain.xml document. If I click the cancel button, the program freezes and I have to use the TaskManager to kill the program. If I re-enter the program and choose to open an existing project, my project will be there. However, upon trying to open the project, I am greeted with the same Gradle: Build loading bar.. I have been searching for an answer for the last 3 days and nothing has worked. Any help is greatly appreciated!
Things I have tried:
Simply letting the program sit for a while to see if it was actually downloading something and was just really slow. I let it sit for 45+ minutes before killing the program.
Uninstalling and re-installing Android Studio
Restarting my computer
Turning off my firewall (Kaspersky)
Running the program as an administrator
Connecting to a different network
Disconnecting my computer from any networks (to force the program to build in offline mode)
Manually downloading Gradle from the link that Android Studio attempts to use when it gets stuck and telling the program to use that file instead of downloading another one.
(I went to this link https://services.gradle.org/distributions/gradle-2.2.1-all.zip, downloaded the file, unzipped it, went to Gradle settings in Android Studio, checked the Offline work checkbox, and finally set the service directory path to my unzipped Gradle folder.)
Hopefully I have given enough information and made it clear what my problem is. If not please tell me what else I need to explain so I can get this issue resolved. Thanks!
Please note I am working on a 64 bit machine running Windows 8. Also, I use studio64.exe
to run the program.
From the discussion we had in the comments, it does not look like you have your gradle on your windows path.
Please change the below to point to your gradle install:
set GRADLE_HOME=C:\<installation location>\gradle-1.11
set PATH=%PATH%;%GRADLE_HOME%\bin
After this, verify that in the terminal running the following works:
gradle tasks
once you get this working, you will want to run the following in your project:
gradle wrapper
This will produce a .bat file which you can then use to run gradle through the wrapper, letting you support multiple native gradle installations.