I have accidentally formatted the hard drive where I had all of my projects. The project I'm currently working on is completely lost, but I have the app running on my device. I didn't generate an apk, I just ran it using the 'run' option in Android Studio to test as a wrote the code.
Is there a way to retrieve the source code in this case? I have tried extracting the apk from the device (inside \data\app[package name]) and using several decompilers tools available, but none of them show me any of my code.
Thanks in advance.
Related
I have an app that is build using React and is wrapped in capacitor. I was having no issues running the app in debug mode on android studio a month ago, or creating release files, but now I am.
I have checked the app-debug.apk (static/js/main.chunk......) file that is created when I select run, and it contains the updated code, I have sent the package to a colleague who ran the .apk on their machine and saw the updated code, but on my emulator and on my android devices, I am seeing an old version of the code.
I have removed all debug-release.apk files on my Mac and followed steps online such as clean build/rebuild, updates off mac, android studio etc but still no luck.
I am at a complete loss now.
Any ideas?
Thanks
Update: After much troubleshooting, we deleted the build folder android>app>build and the rebuilt the app, and ran it, and it fixed the issue.
I have an Android app that I made maybe like 2 years back. I never deployed it to google store as it really is just for me.
I deployed it on my phone and installed via apk or through VS itself (I can't remember).
I recently formatted my phone and now would like to get my app back. I still have the code and opened it in VS 2017, it did an upgrade of my project but I can't figure out how to deploy it to my phone.
I enabled developer mode but still can't figure it out. I tried to copy the apk that VS generated but when I try to install it, I just get "it is corrupt and can't install".
The app is extremely simple. It is one screen with 6 textboxes and 1 dropdown on it.
Just trying to get it back on my phone as fast as possible so I can use it.
I do get some error when I try to see if it will load on the emulator in VS 2017
Severity Code Description Project File Line Suppression State
Error ADB0010: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.<InstallPackage>b__0(Task`1 t)
at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
0
This is only easiest way you are doing. Plug your device via USB cable & press F5.
I am sure you need to check all supported CPU architectures in Visual Studio.
Right click on your project- go to properties
Properties-->Android options-->Advanced-->Supported Architecures
armeabi;
armeabi-v7a;
x86;
x86_64
& check if available, uninstall your app from your real device
settings->apps->uninstall.
Hope it help you.
I've been working on a Xamarin project for a few days and have been testing it fine, but today it has suddenly stopped allowing me to debug the app, either via Live Player, or by connecting my smart phone via USB.
The only error I am getting, as far as I can see, is
Failed to debug your app
I've not got a way of testing it on iOS devices, but the built-in Windows Phone emulator runs the app fine, albeit with an error in my code popping up now and then.
What could be causing the Android version to stop debugging, or how do I at least fix it?
There are a couple of steps that can help with that issue:
Clean the solution and exit visual studio
manually delete the .vs folder in your solution directory
Delete the /obj and /bin folders in your shared code, and in each project for the platforms you are using
if you are developing for iOS, sometimes it helps to restart your mac
Start Visual Studio
Rebuild your shared code project
Rebuild every native project
Beyond that also make sure that you are using the latest versions of Visual Studio, Xamarin and Xamarin.Forms on all your computers, and that the nuGet Packages your project is using are at the very same version each in shared and native code
Also check, if your app isn't throwing an unexpected exception during its initialization. Especially if not caught, it can happen that your app crashes before your code gets executed at all.
In addition you may find further information about what is going on at Help -> Xamarin -> Open logs or in the device management in XCode (iOS only)
Try this :
Close visual studio if open.
Open App Data and then go to
(a) Local\Xamarin
(B) Local\Xamarin\Xamarin.Android
Empty these folders.
Open your project and then try to build your application.
Not a proper solution, but I uninstalled and reinstalled Visual Studio. This seems to have fixed the problem, but I've still no idea why it stopped working in the first place.
So my USB broke and I lost my android studio project. However, on the emulator, I still have my application, and I am able to run it. So my question is how do I extract my apk from this emulator.
I've read numerous threads however they were all about installation, and not extraction.
Thanks for your help :)
Use the Application mentioned in this url. You should be able to do it
http://www.androidapksfree.com/apk/shareit-android-apk-latest-download/
So I have just started my first app in which I have a button and when user clicks on it then it just print the message.
But when I build the app and when I run that app on android studio's console then after opening it crashes and then it stops working.
Meanwhile I have searched for the error and they suggested me to see logcat table or the text file in which I can easily see the errors but after it I am stuck because I have no idea that how can I solve such problem.
Please help me with it.
Not sure how capable you are with android and you haven't given us much info to work with.
could you post a brief description of the logcat from launching the apk to the apk actually crashing?
the logcat is gonna be the best option to diagnose it.
Are you using the android sdk and emulator?
Have you updated the resources and api's?
If you go into the resource list there should a online repo with a whole lot more SDK bits you might find help.
What api's and android version is your apk built from and is your emulator emulating the same android build?
Could be the apks GUI resolution or script related, have you checked through it all?
Microsoft visual studios has a very good debug system and trouble shoot but I'm not sure if android is compatible as I've only used wp8 on it. Worth finding out though.