I have been quite interested in developing an application for my Android device. I downloaded the all the required tools for VS2010 following this guide - http://mono-android.net/Installation/Visual_Studio and everything went pretty smoothly.
Now, the first time I ran the default application and it copied everything to the emulator, it ran perfectly. If I make a simple change to the application and hit F5 to redeploy - it starts the app, but it seems to have the old version on there still and doesn't show my changes. I've cleaned the solution and rebuilt the application, so I don't think its that. I've also completely changed the code (just in case it was something I was doing wrong), but that didn't work either. Oh and the build also succeeds!
Now the Emulator seems a bit flaky and slow...but is it something that I am doing? Is there somewhere I need to clear before hitting F5?
When it is doing the deploy, does it say "Uninstalling the previous version"?
Another thing to try is to manually remove the app from the emulator (Settings -> Applications -> Manage Applications -> -> Uninstall. Then deploy again and see if the new version is copying. This should narrow down if it's a deployment issue or a build issue.
Related
My android project has over 30 build flavors and I started seeing the slowdown. Android Studio just keeps freezing whenever I type a character or add a new line.
Filed a bug with Google but haven't heard back.
Has anyone run into this issue before?
Any help will be very appreciated.
Have you tried disabling Instant Run?
I would need more info on your config but it sounds like you probably have Instant Run enabled. The larger and more complex your project becomes, the higher the impact on IDE performance.
If you haven’t tried already, it’s worth a shot:
Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run
You may need to uninstall Android Studio. After a while it starts to present these freezes kind of without explanation. Whenever I face this type of problem in the IDE I reinstall it and it returns to normal.
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.
I know how to enable MultiDex support, but my problem is the opposite.
Seems like my Android Studio's MultiDex option is enabled by default for some reason.
When I unziped the resulting APK file and checked inside, there were two files.
classes.dex and classes2.dex.
You may say my project may hit 64K limit, but no, it doesn't.
I also tried without any dependencies and with some other gradle settings,
but the result was all the same.
I even put the line multiDexEnabled false, but it didn't help either.
So this time I created another new empty project, and hit the Run button without any modification.
Result? Same.
As you can see, I have two .dex files with very low references.
I don't understand what's happening here..
The reason why I'm trying to disable MultiDex is,
First, my app is really simple with a few dependencies so just don't need it.
Second, the app needs to support even older Android OS.
Third, I want to avoid the Dalvik linearAlloc limitation in the old Android devices.
Finally, I want to know the exact cause of this.
One more fun fact.
I decompiled and looked into the the apk file, and couldn't find the class named MainActivity which was created by default while the app ran on my phone as expected.
The same is true for my real project. The app works well but there isn't my code in the classes*.dex. Yeah, it's fine if the app works without any problem, but it's somewhat annoying because I sometimes want to decompile and see the resulted code.
Things like Instant Run change the nature of the APK. What you get when you run the app from the IDE is different than what you get when you build the app by other means (Build APK(s) in the menu, gradle tasks, etc.).
This is one of the reason why I disable Instant Run, as I'm one of those crazy people who wants to run the same app that my users would run.
Android Studio 3.0 makes another change to the APK, compared to what your users will run: it adds android:testOnly="true", preventing that APK from being installed normally. Probably this is a safety measure, so that you only distribute APKs made through some other build mechanism.
In your case, based on the comments, it appears that Instant Run was what was causing the multidex-style behavior. That may be tied to how Instant Run attempts to patch an already-installed APK, rather than push the fresh APK to the device or emulator.
So, either disable Instant Run or don't analyze the Run output, but instead focus on APKs built by other means.
I download the latest Android Studio 2.0 from Android Develop Website.
But when I change a line of code and use the "instant run", instead of updating the changes, it prompt me "no changes to deploy".
This will happen on code changes and XML changes.
But when I restart Android Studio, things will works fine for once or twice and then "no changes to deploy" Come again!
I used my old SDK on Android Studio older version.
JDK is 1.7.0
Windows7 64
So, is anyone has this same bug?
A lot of people are having this issue as Instant Run is still quite buggy. The best thing to do would be to disable Instant Run entirely by Preferences > Build, Execution, Deployment > Instant Run > Enable Instant Run
Solved by rebuilding Project (menu Build -> Rebuild project)
This sounds like a bug. It would be super helpful to our team if you can report the bug with specific repro steps so we can investigate. Without your help, it's going to be very difficult for us to track down these problems. We want Instant Run to work for you.
You can file a bug at this link: https://code.google.com/p/android/issues/entry?template=Android%20Studio%20Instant%20Run%20Bug
Also having this issue with Android Studio 2.1. Turning off Instant Run seems to have fixed it, which is unfortunate, but I was wasting more time failing to understand why old code was being run than Instant Run was saving me! Running Ubuntu, so agree not just a Windows bug.
Run TAB next to anroid-monitor, sometimes it shows, no changes to deploy mean changes in code has not been added to your app(this bug has been resolved to a great extent).
Sometimes it runs the new app and when you restart your app it shows the old one(this bug has been resolved, officially declared on android site ).
Solution :
Disable instant run under your project settings(you can face some error while gradle build if you switch from instant-Run to normal one then Try clean option or if still there's an error then you can delete those files at the path shown by the error)
Try to use the latest studio release which has totally improved
instant-run.
Not a solution but as a better workaround I'd prefer to:
Press "Recent Apps"
Simply close my app from the list
Run the app again
This takes less time than Clean and Rebuild.
Update:
Rerun the app also works:
When Instant Run does not works correctly:
As far as I realized, Instant Run works properly when I change my views ids otherwise it does't recognise changes in xml and gives me "No changes to deploy"
I also used clean and rerun app or Cntrl+F5 this fix my problem
The following situation will surely be familiar to any Android developer using Eclipse and ADT.
I'm tired of this endless cycle of switching Build Automatically on and off, running Clean, building and running. I'm constantly doing all of these operations when I'm fine tuning UI (i.e., editing XML files and needing to see the results live), and any time I save, an Eclipse window telling me I have these pending operations shows up. When that happens, I turn off Build Automatically. I do my alterations and then run. Sometimes Eclipse decides the changes in the XML file weren't enough, and it won't reinstall the app in the emulator or device, so I force a build and install.
All of this is just wasted time. I've already done an AppleScript to build & run my app into all the emulators and devices I have connected at once, described in this SO question, but my workflow could be much improved if I found a way to save and build silently and fast.
Does anyone have any tips or alternatives?
IntelliJIdea Community Edition now supports Android
Have you tried the bundle for Textmate? It's pretty cool. It's basic but its got all the features you need. Building, Deployment and integration with AVD and Logcat.
I use this for all my Android Dev now as I found Eclipse painfully slow.