Unfortunately app has stopped in Android Emulator - android

I am new to Android and I am trying a few small apps (like Compass). When I run the app in the emulator, it gives the message Unfortunately, Compass has Stopped.
I have no compile time errors.
How do I solve this, and what is causing this?
Thanks in advance.

I had the same error message and found that, in commenting out uses-permission nodes in AndroidManifest.xml I had commented out one that was needed. When I put it back in the app ran fine. I was able to reproduce the error. I needed:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
This was for a barebones index.html, single page app, that displays Hello World.
And the permission above was the only one I needed to do Run As/ Android Application and get it to run in an emulator.
HTH

You have posted no code so it's difficult to see what your problem is. However I had the same issue which has been sorted out here Unfortunately HelloListView has stopped

It probably due to the fact that you don't have accelerometer and magnetic field support.
Go to your AVD configuration and add the following hardware: Magnetic Field Support and accelerometer

First check your AndroidManifest.xml file and write activity tag
For example, you have DisplayMessageActivity.class and package is me.user_interface
tag is:
<activity android:name="me.user_interface.DisplayMessageActivity"/>
You can write this after </activity> tag in AndroidManifest.xml file. Check the path carefully.

Related

Denying clipboard access to com.google.android.as for (Android P Version)

I'm trying to open the Android app, it is crashed immediately after opening the page.
I am using the android P version on(Redmi note 7 pro phone) its crashed only for P version.
Its showing ClipboardService error and the error is like the following.
E/ClipboardService: Denying clipboard access to com.google.android.as,
application is not in focus neither is a system service for user 0
Please help me to handle this error. Thanks in advance.
Found a solution to this issue.
Here is the detail.
Device : Pixel 2
OS : Android 10
Actual issue that led me to the solution was a closer look in the Logcat where I found a Deprecation of HTTP client, which has already happened in Android Pie. Documentation LINK
Solution as per Doc is to add following line inside the application tag in the manifest.
<application
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
.
.
.
</application>
This fixed the issue for me, not just in one but more than one places, each one displayed a different error in the logcat.
Additional SOF Reference Thanks to #wongk

No content provider found for permission revoke - Android

i have a weired problem.
I want to install a app that i made on a Nexus 5 Phone and getting the LogCat error that i postetd below.
The funny think is, if i install this app on my Samsung Galaxy S3 it works fine. Just on my nexus 5 i get those errors and warnings.
And maybe i have to mention that the same OS is installed on both phones, CyanogenMod...
LogCat
http://pastebin.com/5dqdkKPY
android manifest:
http://pastebin.com/rtkeyVw5
Thanks for your help!
I think the reason is you lack of permissions. try add this code to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"/>
Every major android component must be declared appropriately on your applications manifest file. It seems like you are using a Content Provider. Is it a provider you implement? Or is it one of the Android's build-in? In any case you have to declare your "intentions" at the manifest. Take a look here:
http://developer.android.com/guide/topics/providers/content-provider-creating.html#ProviderElement

Android Sample Bluetooth chat

I have tried the sample code of Bluetooth chat from Android SDK. The code has no errors, Installed the APK on device, while opening the Bluetooth chat, Force close is thrown.
I used a real device to debug, i.e. Galaxy Nexus S.
Please help me .
. Thanks in advance.
I managed to fix it by:
Changing the AndroidManifest.xml: Basically upgrading the versions where it works <uses-sdk android:maxSdkVersion="17" android:targetSdkVersion="11" android:minSdkVersion="11"/> the 11th version is Android 3.0 (Honeycomb).
Also deleted the line in the AndroidManifest.xml referring to the style android:theme="#android:style/Theme.Holo.Dialog"
The main activity is BluetoothChat, so looking in the logCat I could see what else is throwing exceptions, the method setStatus around 233 is throwing a NullPointerEception due that the onCreate method needs the following code just bellow the super.onCreate call. Thanks to this post
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
I'm not sure if this still applies for you, but i encountered the same problem.
I downloaded the sample, loaded it on a Samsung S3(jellybean) and it kept crashing after the prompt for Bluetooth. There wasn't any error at first. So i tried using your method of removing
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter()
in the code (on eclipse) and was prompted that it was read only and whether i want to make it writable. Upon doing that a few error came up and that was a prompt to say getDefaultAdapter is for API 5 and current minSdk is 1. Hence i looked up into the manifest file to see why it would be a problem since i put it as minSdkVersion=5.
Upon making the manifest file writable as previously mentioned for the java file, i realized the error was due to this line
android:theme="#android:style/Theme.Holo.Dialog"
it requires an API of 11. Hence i changed to android:minSdkVersion="11" and now it works perfectly.

Android error: Application is not installed on your phone?

I am learning this via Sams Teach Yourself Android in 24 hours.
This is really strange, I run the app in the emulator and I get my splash screen (just some crappy text really) then I press the home button, and click on my app's icon and it gives me "Application is not installed on your phone"
I went into the emulators settings->applications and it's there!
I cleaned the project, uninstalled it from the emulator and re-ran it. Same damn problem.
(project is simple:
6activities, each has a unique text, as it starts it shows the splash activity
I have not even connected the other activities... just this)
You can download the entire source if you want at http://elxotica.com/TriviaQuiz.rar
Ok, got it working after going to the authors website, downloading the support code and going over it and comparing it line by line.
Basically in my manifest file I had
<activity android:name=".QuizSplashActivity"
android:label="#string/app_name">
and again below I had
<activity android:name="QuizSplashActivity"></activity>
which I thought was needed, but it looks like that should not be declared twice.
I fixed the problem but am not 100% sure of the cause :((
My problem was solved with this error when I moved the INTERNET permission statement in the manifest file out of the activity definition and into the application definition - that is, up in the hierarchy, right under the SDK version declaration:
<uses-sdk android:minSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="#drawable/icon" blah blah
I also had the permission defined twice. Compiling did not find the bug, however, running the app on the Android emulator did. "Application not installed" is not very helpful, tho. Rather like, "You fowled up [and if you don't know why, I'm not telling you].
I have no problem to run it on Android 2.2 Virtual Device. Maybe you can try create new AVD and run it there. I´ve had similar problem with new update and creating new AVD solved it...
Yeah, I had the same problem.
Just don't declare QuizSplashActivity twice.
Helped in my project, grettz
Yet another failure mode with the same symptom. I had same permission twice, first like this:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
then like this:
<application android:icon="#drawable/icon" android:label="#string/app_name" android:permission="android.permission.WRITE_EXTERNAL_STORAGE">
The second one turns out not only not needed, but also cause the "Application not installed.." error.
So my application declaration looks like this now:
<application android:icon="#drawable/icon" android:label="#string/app_name">
And all is well in the world.
Same symptom, different cause. I'm not entirely certain what happened, but I will hazard a guess in case it helps anyone. What I know for sure: I deleted the icon, dragged it anew from Applications, problem solved.
At some point I changed which Activity was the entry-point (had android.intent.category.LAUNCHER & android.intent.action.MAIN)
I was trying to open the app using an icon on one of my "desktops", an icon which I had added before making the change in the manifest which changed which Activity was MAIN. So I'm guessing that the shortcut refers to the launcher activity and not the app (makes sense)...
My problem was missing assemblies in the package. But only on some phones.
I enabled "link all assemblies" option in the Xamarin studio and problem solved.
Android project options->Android build->Linker behavior->Link all assemblies.
[I'm using Xamarin studio with mono on Android.]

Application installer tells that my app reads Phone State and identity :-(

Hoi,
I have a simple app with a surfaceview nothing special one would say. However when installing on my phone I get two warnings.
1 - Phone calls
- read phone state and identity
2 - Storage
- modify/delete SD card content.
My really is nothing more than a simple puzzle and I dont understand why I get these warnings.
Any ideas how to avoid this?
Help is very much appreciated,
Kind regards
Jasper de Keijzer.
I guess the warnings you mention are user-permissions in the manifest. Check if you have in your manifest lines like:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
and delete them.
It is most likely due to building the app for Android 1.5 (or earlier) and running it on a 1.6 or later device. According to this answer elsewhere on StackOverflow, you can fix it with the following line in your manifest:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
It hasn't worked for me, though.

Categories

Resources