Android studio dont run an updated app version - java

Few weeks ago I finished develop a new app in android studio.
I moved the project folder into a hard-disk, formated my computer and download android studio again.
I have opened the project and run it and it work perfectly, but when I do some changes in the code and run it again, its just run the old version and not the updated. No matter what I edit in the code, its does not affect the app.
What can I do?

Are you emulating on your computer or the actual device? If you delete the app off the device and run again maybe that will launch the new version. It seems that android studio is running your old project so somewhere in the run configurations you need to make sure that android studio launches the most recent activity file.

Related

Android Studio runs old version of project

I have tried a lot.
I have connected my phone to the android studio to run the app onto. For some reason it will install and run the old version of the app. When I run the app on the emulator on the computer it works perfectly.
I have tried:
Deleting the build folder
Cleaning solution
Rebuilding
Copying the entire project into a new project, building it from scratch and rerunning it (still runs the old version of the other app).
Praying to the coding gods.
Has anyone else had this issue?
All I want to do is run my app on my phone as I'm testing.

Android Studio, System error when i run my application

i'm running my app on android 5.1 API 22. Its too old and my app doesnt work propertly. Android studio give me this error. any application I run on andoid 5.1 give me this error
i disable instant run on android studio.
i try another phone with android 5.1.
i think problem isn't into the code, but in android studio.
this is the error:
Click ("")!
I see from the description and error log, you are not able to install the app on your device. But I am not able to get exact context of the problem you are facing.
My recommendation would be:
It is because of old debug-apk cached in your android studio. I would recommend to Build -> Clean Project -> Rebuild Project and Install Apk. This way, it will clean the old apk and rebuild new one and install it in your device.

Android Studio NullPointerException (no error message) after grey screen/restart

I was programming in Android Studio, on MAC OS X macOS Sierra.
I was debugging code on one emulator, then I started next emulator with different phone. Then accidentally laptop restarted (with the grey screen https://i.kinja-img.com/gawker-media/image/upload/s--HPvl05ih--/c_scale,f_auto,fl_progressive,q_80,w_800/18mfougmh04injpg.jpg).
After boot everything come back, Android Studio too. But I can't debug my apps. I have
Error:java.lang.NullPointerException (no error message)
This happening everytime I try to run my app.
It is on my company project, from git. I tried different versions of code.
I tried also (with chronology):
reinstall Android Studio
reinstall SDK, Virtual Devices
reinstall Android Studio after completly delete it from Mac, using terminal (How to completely uninstall Android Studio?)
reinstall Java (uninstall with the tip from Java webpage (https://www.java.com/en/download/help/mac_uninstall_java.xml)
I don't know what I can do next besides reinstalling OS.
Thanks
Okay.
After that post I also tried cleaning cache, logs and again reinstall Java JDK. Nothing helped.
Unfortunately the only solution which helped - format and reinstall system.
Try File -> Invalidate caches / Restart... in android studio.
you must remove ".gradle" folder into your root project and restart your android
studio.

How to build Android apps without Gradle

First up, I'm totally new to the Android ecosystem and mobile app dev in general. However I am a veteran C#/C++/JS/Java app and web dev. So currently my corporate firewall has rules to prevent our work PCs from connecting online. I'm supposed to be doing android app dev fully offline. I got Android Studio installed and created a test app, however gradle refuses to build offline, even with the "Offline work" option ticked. If I build an app on my internet-connected laptop all goes fine. If I copy that app to my work PC, gradle crashes with "cannot find module XYZ in gradle cache". I tried copying over the<user>/.gradle/caches/ dir from my laptop to my PC but that doesn't work either.
So, I'm left with no option but to attempt to build my android project without gradle. I'd like to use the Android Studio IDE if possible, else I'd fallback to SublimeText. So my question is, how do I build, debug and emulate android apps without gradle?
Things I've tried:
Creating a hello world app on my laptop, building it and emulating it. Gradle updates all its libs and stuff, and I used the AVD Manager to download an AVD image an setup an emulator.
Copying over the test app project dir to my work PC
Copying over the updated Android SDK dir to my work PC (with the AVD image, etc)
Copying over the gradle caches to my work PC
At least you need internet connection once for the first build, then you can go to settings & enable offline. then you can build without the internet connection.
Android Studio makes life easier. Anything other than that is going to very hard.
You can use this gist to download dependencies to a local folder. You can then use:
repositories {
maven {
url uri('c:/path/to/repo')
}
}
To work offline
Shameless plug: I wrote a series of scripts to build a Java/Kotlin Android app, including dependencies, without Gradle. There's a separate script to download packages, which is configured to look for AndroidX packages by default but you can provide it a full URL instead. After that point, running the other scripts is enough to build the app offline.
Link: https://github.com/jbendtsen/tiny-android-template
You can do it through the Intellij with android plugin, however somewhat unsupported features are still existed.
Mostly I work on Android Studio sometimes I'm using IntelliJ community version.
please try...

Android App Does Not Install Correctly When Running From Eclipse

I am building an Android application in Eclipse and I am testing the app on my cell phone (Samsung Galaxy S5). When I Run As -> Android Application in the package explorer with my phone connected the Console says that it installed successfully, however, it does not pull up the application on my phone like normal. It does create an icon in all apps but when I click it a toast pops up saying 'Application not installed.' There seems to be no problem with Eclipse though because I can run this same process with another Android project and it will work just fine. I didn't do anything different with my current project. I did this process successfully with this project and it pulled up like it should before it started not installing correctly. Any thoughts?
Migrate to android studio. Google stopped supporting eclipse in android development. You may not have added launcher activity in the manifest, check it. Or it should be installation error using usb. Try to copy paste apk from your project bin folder to device and install. If doesn't work show your main class file and manifest file.

Categories

Resources