android studio "Activity class does not exist" - android

After importing my eclipse android app into android studio(Importing Non-Android-Studio project), I've tried to run the app on my phone.
No I'm facing:
Error type 3
Error: Activity class {com.abc.appname/com.abc.appname.MainActivity} does not exist.
I've searched and I've read every single article about this topic but couldn't resolve my problem.
Somehow android studio tries to find my package inside the package.
I've specified the launch activity in the run configuration by going trough the projects directory.
If I specify only the activity name as MainActivity it doesn't works because it request the whole package path.
The other stuff as modules and so on was autogenereted, but I couldn't find anything usefull in there.
Thanks in advance.

Same Problem for me was solved by lowering Compiling SDK from "M preview" to API 22 in Project Structure.
But first try uninstalling app in the emulator or device you are using.

I've also seen this when the app was already installed, but under a Work Profile. Deleting the app from the Work Profile first fixed it.

Related

Android Studio reports "Could not identify launch activity: Default Activity not found" when building Kotlin projects

I'm trying to build an Android app using Kotlin and Anko. When I select "Run" in Android Studio I get the error:
Could not identify launch activity: Default Activity not found
Error while Launching activity
and the app does not start. I get this error with both the emulator and with a real phone.
To try and narrow down the problem I tried a couple of sample Anko projects, including android-anko-sample, and they all exhibit this same broken behavior.
I have other Android projects I've written in Java, and they run without this problem, which suggests that this is somehow a Kotlin or Anko specific issue. I can even switch back and forth between one of my Java apps and the "android-anko-sample" app linked above, and reproduce the problem with android-anko-sample consistently, while my Java app works correctly every time.
I have looked at other questions involving this error message, and the solutions posted were either not applicable or didn't help.
One thing I have noticed that's weird is that when I open AndroidManifest.xml (of any of these Anko apps) in Android Studio the names of the activities are shown in red, as if they are errors. Here's how the one from android-anko-sample looks:
Note that the app does get installed on the phone/emulator, and I can tap on the icon and run it. It just won't automatically start when I select run from Android Studio, which is pretty inconvenient.
How do I fix this issue?
I'm using:
Android Studio 2.1.2
Ubuntu Linux 16.04
Oracle JDK 1.8.0_131-b11
Code is here:
https://github.com/vsouhrada/android-anko-sample
The complete contents of a few of Android Studio's panes are available in this gist:
https://gist.github.com/xenomachina/e8027b385661038c3f020a543493eebf
This was caused by not having the Kotlin plugin installed in Android Studio.
To fix, go to File → Settings → Plugins → Browse Repositories, find "Kotlin", and install it.

Xamarin Android Build - No package specified

When creating a shared library application in Xamarin for iOS and Android, i can't install a blank project to either an Android device or the simulator. I get the following error:
Error - no package specified
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets:
Warning: Error: no package specified (test.Droid)
I have tried a variety of fixes but i don't really know what package it is referring to.
Any ideas?
Had same problem. The worst part is that there is not too much to show just says deploy failed with one error message: no package specified. After spending hours looking thru the build logs. It boiled down to one very simple solution:
Repair your Xamarin installation.
Make sure Visual Studio is closed.
Go to Apps & Features.
Find Xamarin in the list.
Click Modify.
Choose the repair option.
That's it.
P.S. By me this trouble started when I moved around the SDK from folder to another. I was consolidating the SDK used by Xamarin with two(!) other ones used by Android Studio.

Android IntelliJ IDEA 14.1: No main class for module

I previously had a working android project when I was using IntelliJ IDEA 14. I could run the project by pressing the play button, and it would install and start the application on my device.
I recently updated to 14.1. The code still appears to compile fine, I can see that it generates an APK and I can view it in the output folder (out/production/myapp/myapp.apk), but now I get an error when I attempt to run the project:
Error:No main class for module: app
I've tried creating two new projects, one based on the Android->Application Module template and another based on the Android->Gradle: Application Module template, and both have the same issue - they spit out the error above with the default configuration.
I assume that this must work on other users boxes, particularly because I haven't found anything online or any bug reports about it, but I guess there is a very minute possibility that I'm the first one to find this.
Is this an issue with IntelliJ IDEA 14.1 or just my box? Any ideas on how to fix it or where to start would be greatly appreciated.
I was having similar issue.
Do you have haxe plugin installed? Try to uninstall and try after that and it should work.

Android eclipse run program causes Installation error: 0

I have an Android application. In the latest version I've moved some code from it into separate Android Library projects (two). One library depends on another and project depends on both libraries. So, as I understand, one library includes into final application "twice" (or something similar to twice).
On the first launch of application I receive following in Console (I am using Eclipse):
Installation error: 0
Please check logcat output for more details.
Launch canceled!
Can anybody help?
Thanks!
EDIT
On the second launch program starts normally.
EDIT
I tried to reproduce error on the emulator and other device, it didn't reproduce! Can a problem be on my device? May be on file not deleted or something else?
I've reinstalled Android on my phone and problem solved :) Not a good solution, but works.

Cannot load the app in titanium android emulator

I am having this problem while running my application in emulator.When I run application it shows in console this error:
[ERROR]Error reading data file
and then nothing happens.Don't know what can be the issue, tried it many ways deleting all virtual AVDs and cleaning up the project again and again but not working anyway any solution for that? I am using 2.1.1 titanium SDK and android V8 (2.2).
sometime this also show this error in console:
[ERROR]No building apps, No launcher activity.
Did the application run before?
Have you tried a clean build or deleting the build directory to perform a full rebuild? You can also have a look into the logcat provided by DDMS to search helpful information.

Categories

Resources