Giter Club home page Giter Club logo

hockeysdk-android's People

Contributors

agusevas avatar armineslami avatar ashtom avatar awbsh avatar bogdannistorbogdan avatar brentwatson avatar davidburstromspotify avatar ericvt avatar erychagov avatar fivemicro avatar friederbluemle avatar giancarloromeo avatar guperrot avatar jaeklim avatar jaredsburrows avatar joelmartinez avatar li-yanzhi avatar lumaxis avatar maratoid avatar matkovivan avatar matthiaswenz avatar maxtanquerel avatar niedzielski avatar sergey-akhalkov avatar soph avatar sschuberth avatar thyeggman avatar untalfranfernandez avatar yulin2 avatar zacsweers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hockeysdk-android's Issues

UpdateActivity AppTheme crash

In my App there is the latest HockeyApp SDK 3.0.2 implemented. My App is build with the Android 5.0 SDK and AppCompat Library from Google. I have set a apptheme (Theme.AppCompat.Light.DarkActionBar) in the styles.xml, to remove the shadow under ActionBar.

<item name="android:windowContentOverlay">@null</item> 

With this style i get a crash without crash report or else if the UpdateActivity is shown (not the dialog). I cant see no more in the logcat except a Fatal Signal 11. I get this crash with the style parameter "android:windowContentOverlay" without it works perfectly.

I can reproduce this behaviour with the following setting:
Motorola Razr i
Android 4.2.1

On a Nexus 5 with Android 5 it doesnt crash.

http://support.hockeyapp.net/discussions/problems/31700-android-updateactivity-style

NullPointerException in CheckUpdateTask.startUpdateIntent call to android.content.Intent.setClass

I got the below HockeyApp crash report from a user.
I don't know specifically what they were doing.

Android: 3.1
Manufacturer: samsung
Model: GT-P7510
Date: Mon Mar 11 15:55:44 PDT 2013

java.lang.NullPointerException
at android.content.ComponentName.(ComponentName.java:75)
at android.content.Intent.setClass(Intent.java:5293)
at net.hockeyapp.android.tasks.CheckUpdateTask.startUpdateIntent(SourceFile:344)
at net.hockeyapp.android.tasks.CheckUpdateTask.access$000(SourceFile:80)
access$200
access$300
at net.hockeyapp.android.tasks.CheckUpdateTask$2.onClick(SourceFile:323)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:168)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4028)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)

The feedback form could have a nicer validation

If I don't add all required information to the feedback form I don't get a detailed message what I did wrong.

It would be nicer to see an error message on each respective edit text with setError.
I could add this but I can't quite find out where you store your strings.

If I get around to it I will prepare a branch that only misses the strings.

2014-09-26 08 32 17

Can't save a picture attachment

I am testing Hockey App on Moto X running 5.1.
Upon attaching picture to user feedback form there is no option to save.
On Samsung S3 which has physical back, home and menu buttons, save option comes upon clicking physical menu button.
Without save option on no hard physical menu button phone, this feature will have very limited use.
Please fix this.

Thanks,
Sai

Execute AsyncTasks on AsyncTask.THREAD_POOL_EXECUTOR

Change all AsyncTasks to use something like this:

    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR1) {
        asyncTask.execute();
    } else {
        asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }

NullPointerException in net.hockeyapp.android.tasks.CheckUpdateTask.startUpdateIntent call to android.content.Intent.setClass

I got the below HockeyApp crash report from a user.
I don't know specifically what they were doing.

Android: 3.1
Manufacturer: samsung
Model: GT-P7510
Date: Mon Mar 11 15:55:44 PDT 2013

java.lang.NullPointerException
at android.content.ComponentName.(ComponentName.java:75)
at android.content.Intent.setClass(Intent.java:5293)
at net.hockeyapp.android.tasks.CheckUpdateTask.startUpdateIntent(SourceFile:344)
at net.hockeyapp.android.tasks.CheckUpdateTask.access$000(SourceFile:80)
access$200
access$300
at net.hockeyapp.android.tasks.CheckUpdateTask$2.onClick(SourceFile:323)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:168)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4028)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)

always_send_crash_reports should be part of published API

always_send_crash_reports is a preference key stored in the application's default SharedPreferences. The preference is used to determine whether crashes should be autouploaded. I propose that this should be part of the published API:

  • The key is not terribly unique and, since the key is stored in the default preferences, may collide with a client key.
  • It's a useful preference to expose in a developer settings UI.
  • There's no other published mechanism for reading this state.

Update dialog commented out in 2.2.0 release

Hi,

we recently upgrading to the 2.2.0 release, and the update dialog stopped working. The code seems to be commented out:

@OverRide
protected void onPostExecute(JSONArray updateInfo) {
// if (updateInfo != null) {
// if (listener != null) {
// listener.onUpdateAvailable();
// }
//
// showDialog(updateInfo);
// }
// else {
// if (listener != null) {
// listener.onNoUpdateAvailable();
// }
// }
}

App crashes when using feedback attachments

The target app crashes when the user wants to add an attachment to the feedback, when this activity has not been declared in the app's manifest: <activity android:name="net.hockeyapp.android.PaintActivity"/>

Best solution would be two-fold:

Hide certain field of the Feedback-View

Currently is is not possible to hide certain fields (e.g. name) of the Feedback-View.

In HockeySDK-iOS this can be achieved with
[[BITHockeyManager sharedHockeyManager].feedbackManager setRequireUserName:BITFeedbackUserDataElementDontShow];

It would be great to have a similar API for HockeySDK-Android like:
FeedbackManager.setRequireUserName(false); or
FeedbackManager.setHideUserName(true);

Changelog missing

Do you have a changelog for the Android SDK as well? On the iOS SDK every release contains a summery about the changes.

android.view.WindowLeaked:

Annoying exception on orientation change with open "Update Available" dialog. I don't see that code on develop branch. Does it mean that issue is fixed on develop, but not pushed to master yet? If yes, when are you going to release new version?

10397-10397/com.testapp.android.debug E/WindowManager﹕ android.view.WindowLeaked: Activity com.testapp.android.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{657ca730 V.E..... R....... 0,0-1026,584} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:346)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:286)
at net.hockeyapp.android.tasks.CheckUpdateTask.showDialog(CheckUpdateTask.java:319)
at net.hockeyapp.android.tasks.CheckUpdateTask.onPostExecute(CheckUpdateTask.java:231)
at net.hockeyapp.android.tasks.CheckUpdateTask.onPostExecute(CheckUpdateTask.java:79)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

Auto upload cannot be disabled when user picks "always send"

Returning false from CrashManagerListener.shouldAutoUploadCrashes() has no effect when the user picks "always send". Maybe this callback should instead be passed a boolean indicating the user preference but have control over whether to ignore that preference or not.

update from 3.5.0 to 3.6.2

when I update HockeyApp

compile 'net.hockeyapp.android:HockeySDK:3.5.0'

to

compile 'net.hockeyapp.android:HockeySDK:3.6.2'

it runs into this error

Warning: net.hockeyapp.android.UpdateActivity: can't find referenced method 'void requestPermissions(java.lang.String[],int)' in program class net.hockeyapp.android.UpdateActivity
Warning: net.hockeyapp.android.UpdateFragment: can't find referenced method 'int checkSelfPermission(java.lang.String)' in library class android.app.Activity
Warning: net.hockeyapp.android.UpdateFragment: can't find referenced method 'void requestPermissions(java.lang.String[],int)' in program class net.hockeyapp.android.UpdateFragment
Warning: there were 2 unresolved references to program class members.
     Your input classes appear to be inconsistent.
     You may need to recompile the code.
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: there were 1 unresolved references to library class members.
     You probably need to update the library versions.
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Exception while processing task 
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:473)
at proguard.ProGuard.initialize(ProGuard.java:233)
at proguard.ProGuard.execute(ProGuard.java:98)
at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074)
at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139)
at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115)
at com.android.builder.tasks.Job.runTask(Job.java:48)
at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227)

Any ideas ?

Don't take only versionCode into account when checking for updates

I uploaded and published a new version of my app to HockeyApp (using the Jenkins plugin), but the app didn't recognise that a new version was available.

Here, the update check requires that the package's versionCode is always increasing:
https://github.com/bitstadium/HockeySDK-Android/blob/6b8453f/src/main/java/net/hockeyapp/android/tasks/CheckUpdateTask.java#L206

But it's annoying to have to update the manifest for every tiny change that you may want to upload to HockeyApp, and the JSON returned by HockeyApp includes both a timestamp and an id field, which should always be increasing.

Can't these also be considered as a sign that a new update is available?
e.g. Version 123 at time X+1 would be an update of version 123 at time X, but version 120 at time X+2 wouldn't be considered an update of either.

Activities should extend AppCompatActivity and not Activity

...or at least offer both variants. Currently it is kinda hard to customize the various Hockey activities to follow the color scheme of the application. At the moment, you either have to modify the framework or define an alternative style. This should not have to be necessary. Especially cumbersome is it, when you want to use the new Toolbar throughout the application. Is this something you plan to support in the next version of the HockeySDK?

Add thread metadata to crash metadata

I got a crash with the usual metadata shown below.

In cases like this (and in general), it would be useful to have more information about the thread the exception was thrown on.

So if at least the thread name could be added to this metadata, that would be handy.

Package: com.foo.bar
Version Code: 123
Version Name: 1.2.3
Android: 6.0
...
Date: Sat Nov 07 09:18:22 MEZ 2015

java.util.concurrent.TimeoutException: android.os.BinderProxy.finalize() timed out after 10 seconds
    at android.os.BinderProxy.destroy(Native Method)
    at android.os.BinderProxy.finalize(Binder.java:459)
    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
    at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
    at java.lang.Thread.run(Thread.java:841)

Update Manager crash

Does not happen consistently. Seems to crash on initial update check. subsequent check passes fine

01-02 11:27:14.209: ERROR/AndroidRuntime(2828): FATAL EXCEPTION: main
java.lang.NullPointerException
at net.hockeyapp.android.UpdateManager.runsOnTablet(UpdateManager.java:189)
at net.hockeyapp.android.internal.CheckUpdateTask$2.onClick(CheckUpdateTask.java:270)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)

Here is a stack trace:

Use continuous integration

Currently "Develop" (1799ad1) does not compile out of the box. This makes it harder for people to contribute to the project.

nicd@Nics-MacBook-Pro ~/w/HockeySDK-Android> ./gradlew assembleDefault
:compileLint
:copyReleaseLint UP-TO-DATE
:mergeReleaseProguardFiles
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:generateReleaseAssets UP-TO-DATE
:mergeReleaseAssets
:generateReleaseResValues
:generateReleaseResources
:packageReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:processReleaseJavaRes UP-TO-DATE
:compileReleaseJava
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateActivity.java:180: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateActivity.java:351: error: cannot find symbol
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                                                      ^
  symbol:   variable M
  location: class VERSION_CODES
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateActivity.java:353: error: cannot find symbol
        requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Constants.UPDATE_PERMISSIONS_REQUEST);
        ^
  symbol:   method requestPermissions(String[],int)
  location: class UpdateActivity
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateFragment.java:189: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                                                    ^
  symbol:   variable M
  location: class VERSION_CODES
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateFragment.java:191: error: cannot find symbol
      if (getActivity().checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
                       ^
  symbol:   method checkSelfPermission(String)
  location: class Activity
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateFragment.java:193: error: cannot find symbol
        requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, Constants.UPDATE_PERMISSIONS_REQUEST);
        ^
  symbol:   method requestPermissions(String[],int)
  location: class UpdateFragment
/Users/nicd/workspace/HockeySDK-Android/src/main/java/net/hockeyapp/android/UpdateFragment.java:202: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
:compileReleaseJava FAILED

Sanitize App ID

  1. Strip all whitespace, newlines, etc.
  2. Check if length equals 32
  3. Check if string matches /[0-9a-f]+/i

In-App failing on Nexus-5 with the Lolipop System image

We´re experiencing this:

We have 2 Lolipop NExus5 with Android 5.0 (LRX21O from the Nexus System images)
We´re using the SDK with gradle:

compile 'net.hockeyapp.android:HockeySDK:3.0.2

And then updating our app from within the app, this dialog is poppling up:
hockey-nexus5-lolipo

Here is the Manifest of the App:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.internet" />

    <application>
        <activity android:name="net.hockeyapp.android.UpdateActivity" />
    </application>

It works on a Nexus7 (2014) with the same image. Also, of course the unknown sources settings is enabled. Updating from Chrome (download and then open the SDK) works.

onCrashesFound - Suggestions, Poor D-UX.

Method: onCrashesFound
Called when the crash manager found one or more crashes. Return true if you want to auto-send crashes (i.e. not ask the user).

Example:

CrashManager.register(this, APP_ID, new CrashManagerListener() {
  public Boolean onCrashesFound() {
    return true;
  }
});

OK I have a few issues with this.

  1. This is a really badly named method call? onCrahesFound() what...? Really should be onCrashesFoundAutoUpload() two words make this method from - what the heck does this do - to "ahh ok return true will do that"
  2. Why does this take an object? you added complexity to the return by having to check for null surely?

As part of good developer UX, if your method name makes no sense without a javadoc.. name it better please :)

UpdateManager memory leak

This is more of a documentation issue than a code issue. Again following the instructions as written can cause a memory leak: http://support.hockeyapp.net/kb/client-integration-android/hockeyapp-for-android

If you do not call UpdateManager.register in onCreate of every activity in you application, if you switch from one activity which does call UpdateManager.register to one that doesn't, you will prevent the activity that does call UpdateManager.register from being gced.

The simple fix is to call UpdateManager.unregister() in onDestroy of any activity where you call UpdateManager.register. The documentation should probably be updated to reflect this. Another alternative would be to suggest the application context be passed in instead of the context of an activity.

Build a .aar

Android is moving to gradle as the build system. In the process they introduced a new format for library packages, .aar. Typically gradle pulls these from maven-central.

HockeySDK-Android should have an .aar on maven-central to easily integrate with gradle-based projects (such as ours ;-)

can't find referenced class org.apache.http.*

With Android M / 6 the Apache HTTP stuff is gone but the SDK uses it a lot.

It can be fixed with

android {
    useLibrary 'org.apache.http.legacy'
}

but I prefer a cleaner way without dependencies to a deprecated lib :-)

Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.protocol.HTTP
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.CrashManager: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.util.EntityUtils
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.protocol.HTTP
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.util.EntityUtils
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.HttpEntity
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.LoginTask: can't find referenced class org.apache.http.client.methods.HttpUriRequest
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.message.BasicNameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.protocol.HTTP
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.util.EntityUtils
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.StatusLine
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.util.EntityUtils
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.StatusLine
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.entity.UrlEncodedFormEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPost
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpPut
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.NameValuePair
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpResponse
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.HttpEntity
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.ClientProtocolException
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.methods.HttpGet
Warning: net.hockeyapp.android.tasks.SendFeedbackTask: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.BasicHttpParams
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.BasicHttpParams
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.HttpVersion
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.HttpProtocolParams
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.HttpProtocolParams
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.CoreProtocolPNames
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.SchemeRegistry
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.SchemeRegistry
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.Scheme
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.PlainSocketFactory
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.Scheme
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.SchemeRegistry
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.impl.client.DefaultHttpClient
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.HttpVersion
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.params.HttpProtocolParams
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.PlainSocketFactory
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.conn.scheme.SchemeRegistry
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
Warning: net.hockeyapp.android.utils.ConnectionManager: can't find referenced class org.apache.http.client.HttpClient
Warning: net.hockeyapp.android.utils.SimpleMultipartEntity: can't find referenced class org.apache.http.message.BasicHeader
Warning: net.hockeyapp.android.utils.SimpleMultipartEntity: can't find referenced class org.apache.http.message.BasicHeader
Warning: net.hockeyapp.android.utils.SimpleMultipartEntity: can't find referenced class org.apache.http.HttpEntity
Warning: net.hockeyapp.android.utils.SimpleMultipartEntity: can't find referenced class org.apache.http.Header
Warning: net.hockeyapp.android.utils.SimpleMultipartEntity: can't find referenced class org.apache.http.Header

Resource leak identified by StrictMode

04-16 17:26:18.443 16425-16434/com.relateiq.android E/StrictMode﹕ A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:278) at com.android.org.conscrypt.OpenSSLSocketImpl.getSession(OpenSSLSocketImpl.java:741) at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92) at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:388) at org.apache.http.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:231) at org.apache.http.impl.conn.AbstractPoolEntry.layerProtocol(AbstractPoolEntry.java:302) at org.apache.http.impl.conn.AbstractPooledConnAdapter.layerProtocol(AbstractPooledConnAdapter.java:146) at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:654) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:370) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) at net.hockeyapp.android.CrashManager.submitStackTraces(CrashManager.java:266) at net.hockeyapp.android.CrashManager$3.run(CrashManager.java:394)

It would be desirable to use java.net.HttpURLConnection anyways, since the apache client is deprecated since Android 2.3.

NullPointerException when no update available

After registering on UpdateManager, if no update is available a NPE is thrown:

11-12 13:59:23.550: E/AndroidRuntime(17938): java.lang.NullPointerException
11-12 13:59:23.550: E/AndroidRuntime(17938):    at net.hockeyapp.android.tasks.CheckUpdateTaskWithUI.showDialog(CheckUpdateTaskWithUI.java:94)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at net.hockeyapp.android.tasks.CheckUpdateTaskWithUI.onPostExecute(CheckUpdateTaskWithUI.java:87)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at net.hockeyapp.android.tasks.CheckUpdateTask.onPostExecute(CheckUpdateTask.java:1)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.os.AsyncTask.finish(AsyncTask.java:631)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.os.AsyncTask.access$600(AsyncTask.java:177)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.os.Looper.loop(Looper.java:137)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at android.app.ActivityThread.main(ActivityThread.java:5103)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at java.lang.reflect.Method.invokeNative(Native Method)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at java.lang.reflect.Method.invoke(Method.java:525)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-12 13:59:23.550: E/AndroidRuntime(17938):    at dalvik.system.NativeStart.main(Native Method)

This is due to the CheckUpdateTask split:

      if (isDialogRequired) {
        showDialog(updateInfo);
      }

was moved to the subclass where it no longer checks that updateInfo isn't null

Add CrashManagerListener.onCrash()

The SDK will not send a crash report until the application is relaunched. Since users may never launch the app again, this gives false crash numbers. Supplying an onCrash() callback will allow the app to restart the application which will send the report. We've a somewhat hacky implementation up here[0] for reference where HockeyAppCrashListener[0] is just a CrashManagerListener with the onCrash() method and HockeyAppExceptionHandler is an ExceptionHandler that calls it when available. An alternative to the callback would be to enable application restart or instant send functionality in the SDK.

[0] https://gerrit.wikimedia.org/r/#/c/237874/7/app/src/main/java/org/wikipedia/crash/hockeyapp/HockeyAppExceptionHandler.java
[1] https://gerrit.wikimedia.org/r/#/c/237874/7/app/src/main/java/org/wikipedia/crash/hockeyapp/HockeyAppCrashListener.java

Obtaining and storing the referent of a WeakReference in CheckUpdateTask causes memory leak

https://github.com/bitstadium/HockeySDK-Android/blob/3.0.1/src/main/java/net/hockeyapp/android/tasks/CheckUpdateTask.java#L95

activity = weakActivity.get();

turns the weak reference back into a strong reference, since activity is a member variable of the long lived CheckUpdateTask. This memory leak is detected by Android's strict mode and can also be verified by collecting a heap dump and inspecting it using jhat.

Here is an example heap dump showing the path of the reference originating in HockeySDK that causes the leak:
leak

I would recommend to store the WeakReference instead of the referent in the member variable and only resolve the reference when you really need it (and then of course test for null and back out if the WeakReference got destroyed).

A work around to fix the leak is to do this in any activity that calls UpdateManager.register:

    @Override
    protected void onPause() {
        UpdateManager.unregister();
        super.onPause();
    }

FeedbackManager: can't find referenced method setLatestEventInfo

With Android M / 6 the method public void setLatestEventInfo(Context context, CharSequence contentTitle, CharSequence contentText, PendingIntent contentIntent) in android.app.Notification is gone.

This means that the HockeySDK can't be used with Android M / 6

Warning: net.hockeyapp.android.FeedbackManager: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: net.hockeyapp.android.tasks.ParseFeedbackTask: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification

Missing entry for "hockeyapp_crash_dialog_neutral_button" localization key

Hi guys! Am I missed something, or the key "hockeyapp_crash_dialog_neutral_button" is missing in LocaleManager.java?

I had to assign the key manually loading from resources then using Strings.set:

int resId = context.getResources().getIdentifier("hockeyapp_crash_dialog_neutral_button", "string", context.getPackageName());
String string = context.getString(resId);
if (!TextUtils.isEmpty(string)) {
    Strings.set(resourceId, string);
}

Tracking Documentation

The Tracking class, outside of javadocs doesn't appear to be documented. Comments on the forums seems to indicate that this is not yet supported. Clarification would be appreciated.

NPE in FeedbackActivity on Android 5

I just experienced a crash using a Nexus 5 running Android L running HockeySDK 3.5.0-b.4 .

What I did: I tried to send feedback in my app and attached an image to the feedback, drawing on it. Once I clicked save on the FeedbackActivity, the app crashes with the stack trace attached. Inspecting it a bit, I found out, that the default Android L File Browser does not send absolute paths, and therefore the input stream can not be created.

Using another file browser works, also using a different OS version (KitKat) works.

---- STACK TRACE ----

11-24 11:19:39.459 10002-10002/app E/HockeyApp﹕ Could not save image.
java.io.FileNotFoundException: /data/data/app/cache/HockeyApp/primary:Pictures/Screenshots/Screenshot_2014-11-24-10-54-29.png: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileOutputStream.(FileOutputStream.java:87)
at java.io.FileOutputStream.(FileOutputStream.java:72)
at net.hockeyapp.android.PaintActivity.makeResult(PaintActivity.java:166)
at net.hockeyapp.android.PaintActivity.onOptionsItemSelected(PaintActivity.java:106)
at android.app.Activity.onMenuItemSelected(Activity.java:2882)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1127)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:761)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:904)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:894)
at com.android.internal.view.menu.MenuPopupHelper.onItemClick(MenuPopupHelper.java:179)
at android.widget.AdapterView.performItemClick(AdapterView.java:300)
at android.widget.AbsListView.performItemClick(AbsListView.java:1143)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3044)
at android.widget.AbsListView$3.run(AbsListView.java:3833)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
at java.io.FileOutputStream.(FileOutputStream.java:87)
at java.io.FileOutputStream.(FileOutputStream.java:72)
at net.hockeyapp.android.PaintActivity.makeResult(PaintActivity.java:166)
at net.hockeyapp.android.PaintActivity.onOptionsItemSelected(PaintActivity.java:106)
at android.app.Activity.onMenuItemSelected(Activity.java:2882)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1127)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:761)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:904)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:894)
at com.android.internal.view.menu.MenuPopupHelper.onItemClick(MenuPopupHelper.java:179)
at android.widget.AdapterView.performItemClick(AdapterView.java:300)
at android.widget.AbsListView.performItemClick(AbsListView.java:1143)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3044)
at android.widget.AbsListView$3.run(AbsListView.java:3833)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-24 11:19:39.527 10002-10002/app D/AndroidRuntime﹕ Shutting down VM
11-24 11:19:39.528 10002-10002/app E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: app, PID: 10002
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3, result=-1, data=Intent { (has extras) }} to activity {app/net.hockeyapp.android.FeedbackActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:3539)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3582)
at android.app.ActivityThread.access$1300(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1327)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at net.hockeyapp.android.utils.ImageUtils.determineOrientation(ImageUtils.java:84)
at net.hockeyapp.android.views.AttachmentView.loadImageThumbnail(AttachmentView.java:286)
at net.hockeyapp.android.views.AttachmentView.(AttachmentView.java:102)
at net.hockeyapp.android.FeedbackActivity.onActivityResult(FeedbackActivity.java:681)
at android.app.Activity.dispatchActivityResult(Activity.java:6135)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3535)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3582)
at android.app.ActivityThread.access$1300(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1327)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Android M removes method Notification.setLatestEventInfo

When compiling against API 23. It should use NotificationBuilder as suggested here.

Warning: net.hockeyapp.android.FeedbackManager: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: net.hockeyapp.android.tasks.ParseFeedbackTask: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification

Sorry didn't not find #79 first. Should be closed

CrashManager.register() requires an Activity Context, not just any Context

Trying to call CrashManager.register() with an Application context will lead to the following crash everytime we try to launch the application with crash files to send:

02-13 14:01:11.976: ERROR/AndroidRuntime(7835): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {com.foo.app/com.foo.app.MyActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2742)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2771)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2235)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.view.ViewRootImpl.setView(ViewRootImpl.java:571)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:246)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:281)
at net.hockeyapp.android.CrashManager.showDialog(CrashManager.java:345)
at net.hockeyapp.android.CrashManager.execute(CrashManager.java:160)
at net.hockeyapp.android.CrashManager.register(CrashManager.java:110)
at net.hockeyapp.android.CrashManager.register(CrashManager.java:97)
at com.foo.app.MyApp.checkForCrashes(MyApp.java:37)
at com.foo.app.MyActivity.onResume(MyActivity.java:109)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185)
at android.app.Activity.performResume(Activity.java:5182)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
... 12 more

Passing in an Activity instance rather than an Application instance fixes the issue

App built using Android Studio crashes when trying to send feedback

Steps to reproduce:

  1. Create a new app in Android Studio (0.8.14 beta)
  2. Integrate SDK using jar from latest release (3.0.2) or newer in the libs folder
  3. Setup SDK FeedbackManager with register(...)
  4. Show the feedback activity with FeedbackManager.showFeedbackActivity(...)
  5. Run the app and try to send some feedback

Results:

The app crashes with the following stack trace (example from demo app):

11-14 11:47:54.190  19525-19551/de.bowstreet.paperbag E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #5
    Process: de.bowstreet.paperbag, PID: 19525
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:300)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, host=null, path=nullapi/2/apps/null/feedback/
            at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:591)
            at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:293)
            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
            at net.hockeyapp.android.tasks.SendFeedbackTask.doPostPut(SendFeedbackTask.java:228)
            at net.hockeyapp.android.tasks.SendFeedbackTask.doInBackground(SendFeedbackTask.java:149)
            at net.hockeyapp.android.tasks.SendFeedbackTask.doInBackground(SendFeedbackTask.java:69)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)

Note

  • Providing the url parameter when registering the FeedbackManager does not solve this
  • This only happens in builds with Android Studio/Gradle not when using Intellij/Maven

Disable CrashManager

We need to disable/enable the CrashManager while the App is running. I could not find how to do this.

InstalledFromMarket always returns true

whenever we use Xiaomi, the installedFromMarket always return true.

Because when we debug via usb, it will display installer = "adb"

when we install via browser, it will shows installer = "com.android.browser"

Based on the written code, the result will always returned true whenever it's not empty.
result = !TextUtils.isEmpty(installer);

Support for Localization

We'd like to add the feedback feature into an app where the target users base is not english. The sdk neither contains translated resources nor provides a way for integrators to translate strings.

CrashHandler Memory leak

The offending lines are 380-382 in src/main/java/net/hockeyapp/android/CrashManager.java.

The memory leak occurs if you follow the instructions listed here to customize how crash reports are handled: http://support.hockeyapp.net/kb/client-integration-android/customization-options-for-android

The API and instructions given seem to imply that every time you call CrashManager.register, any references to the old listener are dropped in favor of the new one and the thread's exception handler is updated. In reality the check in line 380 prevents you from ever updating the exception handler, which seems less than ideal in and of itself. More importantly, it causes you to leak the first activity you ever create unless the CrashManagerListener you pass in is static because the listener references the activity and is referenced by the ExceptionHandler, which in turn is referenced by the Thread.

I'm not attaching a fix because this could simply be a communication problem. If there is a reason to prevent people from ever updating the listener, then perhaps the documentation should note that the listener must be static.

I think the safest thing to do would be to require the initialize API call to occur in the application so any non static listener references only the application. You could then have a separate call to execute to actually send crash reports in on resume of any activity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.