AdroidStudio 2.2.2 Empty Activity Error on phone - android-studio

I just started learning about Android development, so this one is a serious issue for me: I launch Android Studio (2.2.2, but had the issue since 2.2.1) on Win10, make a New project, just keep clicking Next without changing anything (selecting Empty Activity as the template), Finish, try to Run 'app' on my phone and consistently get this error:
Error while executing: am start -n "com.example.android.myapplication/com.example.android.myapplication.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.myapplication/.MainActivity }
Error type 3
Error: Activity class {com.example.android.myapplication/com.example.android.myapplication.MainActivity} does not exist.
Error while Launching activity
Being a complete newbie who was just supposed to change some text in XML and run the app on a phone, I have no idea what to do or edit to make a pregenerated app actually work. I searched StackOverflow for a more general approach to these errors and tried:
Restarting AS/computer
Disabling InstantRun
Messing with Clean/Rebuild/Synchronize/Sync with Gradle
Deleting .gradle and .idea folders and Syncing with Gradle
Some other obscure shenanigans with build.gradle and AndroidManifest
Various combinations of the above.
... None of which worked (or affected the problem in any way, in fact).
Other observations:
The app isn't even installed (checked All apps, there isn't any com.example.android.myapplication or MyApplication app on my device)
On the development course forum, it was suggested that com.example.android.myapplication/com.example.android.myapplication.MainActivity should only read com.example.android.myapplication/MainActivity. So far I haven't been able to figure out how to change that.
Update 1 New attempted fixes (neither of which worked):
Specified activity directy in Run/Debug window.
Specified no activity whatsoever (doesn't show that error, but doesn't run anything either).
Did File/Invalidate Caches
Changed android.intent.category.MAIN to all-lowercase and back.
Added "category android:name="android.intent.category.DEFAULT"/" to Manifest
Update 2 Managed to run the app on emulator. It seems to be working there, so the error will likely be somewhere between AS and the phone (Android 5.1.1, API 22).
Developer options and USB debugging are on (confirmed the pop-up message, too)
Driver is up to date (AS can see the phone without problem)
Phone is on (and not asleep) while I'm trying to run the app
Any suggestions why the phone won't download and run the app?

In your manifest file edit
with android:name="com.example.android.myapplication.MainActivity"

Make sure that your code doesn't mean any nonsense and that it wouldn't cause the app to crash, which is sometimes the problem. Try finding a problem in code which could crash the app. Maybe in your crash log you can find what causes the crash. Good luck fixing that.

According with your error log I suppose you did not delete previously installed app. See my accepted answer on the same question for details.

Related

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies error while publishing my MVC .net 3.1 core project to Azure

Not sure what details I should be providing to be completely honest, other than I googled and searched for this solution and I deleted everything and retried and didnt work out, I downloaded all the files needed, I added application settings and it added an error for me telling me that I need to install or update Microsoft.WindowsDesktop.App, version 3.1.0, which I have installed and already existed anyway
I tried going to application event logs on Azure portal, there was 3 errors first this one which some people suggested going to web.config and changing it to Module not v2, and I dont see any web.config file in my mvc project
2nd error which I already talked about but its just not working, so I assume somehow its not seeing it??
3rd error Also this I am not quite sure what to do with it.
Lastly, as I said I am not sure what information I should provide, I dont have much time and I was asked to publish it on azure there was no problems and seemed easy but errors popped up and nothing on the internet fixed my issues, you can comment and I will add any required data to fix this.
Thanks in advance
I installed each and every package in the dotnet folder to make sure everything is right and everytime it recognized there is a file already and asked me if I want to repair I said yes but that didnt help
I checked my .json file if it had any errors like some people suggested
checked if Azure portal specified that I am using ASP.NET 3.1core which it did
~~I used search for "stdoutLogFile" to check if I can find it anywhere on my solution since I cant find my web.config but I there was no result~~
I found out that I can add the web.config and make changes to it, and I did so but there was no result for it, still same error (yes I change the publish profile and republish to make sure it took the changes)
[enter image description here][1]
[1]: https://i.stack.imgur.com/rgiVi.png I got these errors when I opened the profile.arm.json folder under the server dependency folder

Azure Functions Core tools suddenly stopped working

I was in the middle of working on some minor code changes when all of a sudden I started getting the following error on startup:
A host error has occurred during startup operation '78d5d8fd-e81c-4707-87ca-6b801430fef1'.
[2021-01-08T13:02:40.279Z] System.IO.FileSystem: Could not find a part of the path 'C:\Users\schiefaw\AppData\Local\AzureFunctionsTools\Releases\3.17.0\workers'.
I looked at the path and found everything exists until I get to "workers".
I, of course, assumed it was something I did, so I backed out all changes to no effect. Then I uninstalled visual studio and all Azure products I could find and reinstalled to no effect. I created a new user (since the file it is looking for is in my user folder) to no effect.
I then created an entirely new instance of a windows virtual machine and installed the development environment to no effect (same error).
I am completely stuck on this. Does anyone have any ideas on what I can try next?
Thanks!
I think this is a bug from that 3.17 release. But here is a work-around: you can add the "workers" folder (empty folder) and it should work. Another way if you have a copy of the previous version (such as 3.16.x), you can copy the content to the 3.17.0 one.
You can read more here: https://developercommunity.visualstudio.com/content/problem/1304718/azure-functions-local-debugging-broke-with-3170-up.html

How do I run MyLocationDemoActivity.java?

How do I run MyLocationDemoActivity.java? I got this file from GitHub this is the link:
https://github.com/googlemaps/android-samples/tree/master
I am completely new to Android Studio, what are the steps to run this file?
On the getting started subtitle when you scroll down on the GitHub site, it tells says to create a file on the "root directory" called secure. properties. I am sorry, but I have no clue what or where the root directory is located and how to create the file. But I did get an Google Maps API key.
I also did import the project, but how do I add an emulator. I have downloaded the emulator and it works because on a different project I created a Google Maps Activity Project and just ran the sample code putting a marker on Sydney. I am not sure how to add the emulator to the project I downloaded from github though. I tried to add a template configuration for an android app, but it says no module. How do I add that? In summary, I am just looking for a step by step way to run this file.
(Also, I am sorry if this seems like a mess of questions, but I really have no idea what I am doing)
You question sounds too generic, so I will give some suggestions:
demo activity could not be run separately, you have to create a full environment of android and open the main activity, then open this demo activity
Don't use emulator for developing Map features, use a real device. In fact, I always use "Real Device" when developing, because "emulator" seems lots of bug, and its speed is very slow.
when studying a new tech/skill/feature, bit by bit. e.g.
3.1 you should know some knowlege about android main activity, android basics
3.2 play with emulator and real device, and know adb commands
3.2 play with DemoActivity
good luck!

codedu ui gives access is denied error for the program under test

I dont know if anyone ever come up with this situation but today I come up with this weird situation with codedu, nothing works when I run tests. Today when I come to office , installed AccessDatabaseEngine for datadriven test and start a testMethod, none of my records are running, I took a new record and also not working. Restart VS or restart PC doesnt help. Please somebody help me getting out of this situation. When I run a test, it bring up the already open application (UAT) but can not play.
I am not sure whether its cause but I installed AccessDatabaseEngine before running any test. I tried to uninstall it but when I look at applications I cant see where its placed..
I noticed that I doesnt record all, I tried to record a new test. It throws "Access is Denied", while capturing the application
and it gives Control not found error when I try to run
I found some pages for same error
I checked CodedUITestBuilder config file and I see this line was commented and I changed it but this did not fixed.
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
I also tried changing properties of CodedUITestBuilder.exe but again same result
Coded UI Test Builder fails to generate code for recorded action
Its fixed after I uninstalled the AccessDatabaseEngine . I installed it by clicking same exe. I should not install it because its too old, that is obvious with its icon.

IndexNotReadyException when building the application

Writing an android application. It has no errors when I run it on an emulator. But when I tried to build it to an apk file to test on a device, I get the following error.
com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:853)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:802)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:786)
at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:250)
at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:238).......
I seen one similar case raised here which mentions to "Wait till indexing is complete."But I am not sure what I am doing to even interfere with any indexing.
Tried on different computers. Same problem. The only thing I did different before I got this error was to add a dependency at gradle(app) for a RingButton and added that RingButton class to the project to modify it to what I wanted.
As I said it is working fine in emulator.
Just to test if that is indeed the isse, I deleted the class and removed the dependency but the issue is not resolved.
I think this can be solved by creating a new project and moving the files into the new one. Maybe the index is corrupt. But before that can you clear the cache ? in android studio if your prepared to lose some local history then try this:
and then chose invalidate and restart:
I was using Dropbox to constantly backup my project every now and then. So I would click my project and send to Dropbox. I was also instantly clicking run to run the app on my emulator at the same time. During this period, when I mouse over my Dropbox icon, there is an indication that it is "Indexing".
Based on previous answer "Wait till indexing is complete", I can only assume this Dropbox indexing interfered somehow.
Not exactly elegant but I copied each and every file in this project into a New Project and everything is working fine now and able to install the apk file. I didn't change anything so I believe there is some form of corruption in the old project.

Resources