Android Studio runs old version of project - java

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.

Related

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.

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.

Android projects not running in eclipse

I am facing a so weird issue with my eclipse. Android projects are not running in my eclipse
I'm using
Eclipse version 4.4 Luna ,
android SDK latest API level 23
(even earlier versions is not working ).It was running well till some days ago , and all other java projects running fine like web and desktop etc..
Whenever I am running the android project it shows the error dialog box, though no errors are there in the project(for a new project also), I have tried clean build, cleared cache, updated eclipse adt , and is there anything left I need to try other than formatting PC?
Well ,after some struggle I have found out what is the actual problem. It was my debug.keystore file.
I have got an error in my console saying Debug certificate expired
Well I have found my debug.keysotre file in here %USERPROFILE%/.android and deleted it. Eclipse itself will generate a new one when compiling a new project. You may need to clean and then build to generate the certificate.
Thanks everyone for your support.
Problem solved !!! :)

Android studio dont run an updated app version

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.

Categories

Resources