I have an application on google play.
I made a new version with a higher versioncode and different name.
Tested it on my own android device (v2.3.3) and an emulator (v4.0.3).
No errors so far, so i put the update on the market.
Now the first error reports come in!!!!! (see below)
I dont know what it means.
The new update was a little change in the permissions and i removed two libraries (jumptap SDK and jumptap adapter for admob mediation).
The removed permissions were:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Leaving these two for admob ads:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
The error code:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.masked.app/com.masked.app.mainjava}:java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2705)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$2300(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4669)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.masked.app.mainjava.onCreate(mainjava.java:53)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
At line 132 there is "adblockcheck();" that can be found here
How to prevent ad blocker from blocking ads on an app ;
line 123 is also within this code.
At line 53 a mediaplayer is started (mp.start();) with a starting sound.
What is the problem exactly, and why don't i get the error on my devices?
This is my first error report through google play, is one error problematic or are there more developers that experience errors and don't always care about them?
Full Mainjava.java can be downloaded here http://homepage.tudelft.nl/78u5u/main.zip
EDIT:
R.raw.start is a mp3 file.
Obviously, your MediaPlayer mp instance is null. It means that MediaPlayer.create method returned null.
As said in android documenation for create method:
Returns
a MediaPlayer object, or null if creation failed
I think, android can't create MediaPlayer for you beacuse of lack required codecs or so on. What is format of your R.raw.start file? You can try to play with formats.
Whatever, you need to gracefuly handle this exception.
Also, as just said before, I advice you to use ACRA. It can help you resolve problems quickly. By my expirence, Android users don't like to send error reports. Less than 10% of errors are reported to the google play.
UPDATE:
ACRA is good enough, but not perfect, because of blocking. It means that if app is just crashed and user have slow internet connection, you can get the ANR message. Let imagine: User thinks that app is just hang, and decided to wait for app response and then gets "Sorry, app crashed" message. You must find the way to send reports via background service or so on before using ACRA.
Also, Google Docs - default backend for sending errors - is awful. It is highly recommended to use another backend. If your app is small enough and you think you will receive less 500 error reports in a month you can try proprietary BugSense, it is supports ACRA.
It's going to be hard to tell what is really going on without seeing (at least) your whole onCreate() method in com.masked.app.mainjava. It sounds like you didn't initialize your media player.
If anyone else is having trouble with crash reports, this is an AMAZING way to get better feedback on Android is this project: http://code.google.com/p/acra/
EDIT:
Your problem is almost certainly caused by the a codec issue (your device cannot play the given resource due to its filetype/format). What type of sound file is it?
You can get around your issue by changing this block:
if (startsoundint == 1){
MediaPlayer mp = MediaPlayer.create(Mainjava.this, R.raw.start);
if (mp != null) // null check
{
mp.start();
}
}
And yes, this means it's probably not a new bug, unless you changed the sound file.
Related
I have an Android sender app and Android TV receiver app. When I start to connect the Android TV receiver app, it returns an error code 2255 in onSessionStartFailed().
I have referred the Google Cast documentation (https://developers.google.com/android/reference/com/google/android/gms/cast/CastStatusCodes) and cannot found the definition of 2255 in this page.
Also, I try to read the code from com.google.android.gms.cast.CastStatusCodes, it seems that error code 2255 is a special case.
if (var0 < 2300) {
return String.format(Locale.ROOT, "Cast remote display status code %d", var0);
}
Thanks in advance.
Not sure if this is your issue, but this can happen if you try to run the Cast Debug Logger on a non-google receiver hardware.
As it says:
Warning: Make sure to change setEnabled to false for a production receiver.
Properly disabling it in prod fixed the issue for me. But, man, it's so bad that error codes are not properly documented. There are several other that can also be thrown for various reasons that are undocumented.
What was actually happening for me is the CAF library was throwing an exception because it is trying to load the debug logger, but the debug logger is not supported on non-google hardware. This caused the VM to not launch properly and so it started throwing remote display errors.
If that is not your issue, you should try to log in to the back-end if your device if possible and download an error log. Sometimes that can highlight what is happening. I don't know if it's possible to crash the VM in other ways, but it might be and the error log might show why.
I'm getting this AudioTrack warning
AUDIO_OUTPUT_FLAG_FAST denied by client
in my Android app for a button I'm subclassing. I can hear a click when tapping on the button so is this anything to worry about?
Note: I'm not getting the mismatching sample rate message as in this question: AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate
Most likely, the tap sound got a AUDIO_OUTPUT_FLAG_FAST in order to use low-latency playback if possible, but the AudioTrack class considered the track settings to be incompatible with the low-latency audio output, so the flag got removed and the track got treated as if the flag hadn't been set to begin with. So I wouldn't consider this to be something to worry about.
As for the reason why the flag got denied; I'd still say that the most probable reason is a sample rate mismatch. The log in the question you linked to appears to have been added in this commit to the AOSP. But if we look at the master branch of the code base used on many Qualcomm-based devices we see that it still has the "AUDIO_OUTPUT_FLAG_FAST denied by client" log in the case were there was a sample rate mismatch. Which logs you get depends on the exact implemetation running on your device (i.e. which device and Android version you're running).
Try changing the sample rate at
"frameworks/base/
frameworks/av/
hardware/libhardware" locations.
default sample rate is 44100 try setting the sample rate you want (your audio files have).
it will work.
cheers.
I had the same problem, my problem was caused because I forgotten type activity define in manifest file. such as : activity android:name=".NFCReaderActivity"
I am developing an android app. My app gets crashed often. I want to save the logcat messages in sd card while the apps gets crashed to find the root cause. Is ther any way to do this?
A few ideas which might help you step toward fully automated crash log gathering. We have yet to roll a full system here, we've had enough luck with just grabbing devices after they've crashed or asking for more info from our QA group, but:
ACRA is relatively easy to implement, and even if you don't implement it, the source is on github for you to poke around in.
The related question Android crash reporting library (pre Froyo) has a number of links and solutions, including android-remote-stacktrace, the aforementioned ACRA, Android-Error-Reporter, and other commercial solutions.
Some devices capture the crash output automatically, you can grab it via adb pull /data/log/dumpstate_app_native.txt.gz or similar -- the paths should appear in logcat. These tend to be overwritten with each crash, though. (If anyone can answer whether this is a manufacturer-specific feature or something that appeared in some version of android's core, I'd love to know!)
You can get a logcat app, e.g. aLogCat or many others, that you can install on your device.
TestFlight is going into beta on Android side; they have crash reporting on the iOS side and should on the Android side too, and there are various other lovely benefits to using their services -- and integration is really easy in our experience.
If you're rolling your own inside your app, you need the READ_LOGS and WRITE_EXTERNAL_STORAGE manifest permissions (even for local builds), then you can use the logging API or a regular File.copy or even a system call off to logcat itself. There are a bunch of options and examples in the "Related" links to the side of this question:
Stream android logcat output to an sd card
How to redirect my log output from logcat to the SD-Card on an android device?
...and so on.
Hopefully this helped.
Reading your own logcat messages is covered by other questions.
how can i access logcat file on device
Read logcat programmatically within application
In order to do this when your app crashes you need to install an defaultUncaughtExceptionHandler.
Either on your activity on create or your application on create. Add the following code.
final Thread.UncaughtExceptionHandler oldUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
#Override
public void uncaughtException(Thread thread, Throwable throwable) {
// DO your error handling here.
// Write your log cat, or write your exception stack trace here.
// Get rid of this line if you don't want a popup letting you know that your app has crashed.
oldUncaughtExceptionHandler.uncaughtException(thread,throwable);
}
});
My clients using my application on ANDROID and a lot of them are reporting uncaught exception error while using my Flex 4.6 application with latest Flash Player 11.1 swc.
My Flex application uses standard SPARK and MX components. The uncaught exception occurs immediately after application is launched, however none of my functions (connecting to RTMP, RTMFP & socket servers) seem to cause it, the error occurs after all the functions that I call upon program start have successfully executed.
Looks like error code #2063 means "Error attempting to execute IME command.".
My code doesn't call or access any IME functions at all.
It seems that this developer is experiencing same issue and is unable to locate the solution or workaround:
Flex/Flash runtime error #2063 on android
Also, none of the clients using Windows/Mac/Linux are experiencing this issue, only Android clients.
And they all are accessing same application/same code/exact same file.
It also seems like clients are not doing anything specific that triggers this error - they just start my flash site on their android browser and do not do any interaction with it, and getting this error just after launch.
What do I do / what is the best work around for this issue?
And I obviously don't have a stack trace, because my users are using it DO NOT use Adobe Flash Player debugger, however this person and posts seem to be exactly same issue and they have stack trace: http://forums.adobe.com/message/3410527
I have also submitted this issue to Adobe BugBase: https://bugbase.adobe.com/index.cfm?event=bug&id=3101786.
Thanks
can you add to your code the UncaughtErrorEvent.UNCAUGHT_ERROR listener on the main movie loaderInfo object? If you can then it should intercept this error and you can collect some information about it or just ignore it if it doesn't break your application.
best regards
I have an application which is mostly native code written in C: Simon Tatham's Puzzles. When I catch a crash (with a signal handler), a Java backtrace will only tell me the vague area of the problem:
W System.err: at name.boyle.chris.sgtpuzzles.SGTPuzzles.resizeEvent(Native Method)
W System.err: at name.boyle.chris.sgtpuzzles.SGTPuzzles$1.handleMessage(SGTPuzzles.java:126)
W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
What I need in order to have any hope of diagnosis is the native backtrace that the Android framework writes to the log:
I DEBUG : #02 pc 0003e8ae /data/data/name.boyle.chris.sgtpuzzles/lib/libpuzzles.so
I DEBUG : #03 pc 0003ed62 /data/data/name.boyle.chris.sgtpuzzles/lib/libpuzzles.so
I DEBUG : #04 pc 00059060 /data/data/name.boyle.chris.sgtpuzzles/lib/libpuzzles.so
As far as I know, Android Market's crash reports don't include native traces... do they?
Therefore, I currently have my own crash catcher and reporter, described in this previous question, which will offer to drop you into an email compose window with your log in it. That works well enough, with one problem: users don't read (or don't believe) the explanation in the package description and are scared away by the permission request.
It's not these few comments that bother me, it's the unknown number of people who ran away without even installing it. :-(
So how do I get a native backtrace on crash without making the game require a scary-looking logs permission? Possible solutions include:
I'm wrong and Android Market will actually give me native traces these days?
Recommend when I catch a crash that people immediately install and run Log Collector? This is what I'm leaning towards currently. Anyone got a good example of this being done, with well-written explanatory text?
Having caught the crash with a signal handler (which I can do), any way to read my own native stacktrace? More difficult on Android/Bionic than on glibc platforms, no backtrace() available. Edit: Most things under here appear to be required: http://github.com/android/platform_system_core/tree/master/debuggerd - to include enough of it in the project would be overkill, bloaty, difficult, unsupported, brittle on ABI changes/additions. Doesn't seem like a good use of time.
Edit: From Jelly Bean onwards, neither you nor Log Collector can read debuggerd's output, because READ_LOGS went away. :-(
But, Play Console's crash reports now include native stack traces (at least as of late 2014), which makes this all much less necessary.
Previously:
I shall give my answer in the form of a git commit:
https://github.com/chrisboyle/sgtpuzzles/commit/e9917f1ffe93f9d9963463db849e3768beafccee
This is delegation to Log Collector, as I hinted at above. I catch the crash as before (see my previous discussion of how to do that) show an "oops, I crashed" screen as before, and if the user clicks Report, then I prompt them to install Log Collector if they haven't already.
If I've sent the user off to install it, as soon as it finishes installing, I catch the PACKAGE_ADDED Intent and launch Log Collector with appropriate options (I warn that I'm going to do this). This is so that the user isn't left guessing that they should click Open, which would launch it without my destination, subject, and filters.
The filters are worth having, as they limit what is sent in the email to lines that might be relevant. This saves the user's bandwidth and my inbox capacity, and means the user can more easily check that there's nothing sensitive in the log and is therefore more likely to agree to send it.
There is another way to access all logs without any special permissions, but it requires enabling remote debugging on the phone. Take a look at the open source rootless Logcat app.