Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application freeze and not show handler #2

Closed
Caceresenzo opened this issue Apr 28, 2018 · 22 comments
Closed

Application freeze and not show handler #2

Caceresenzo opened this issue Apr 28, 2018 · 22 comments
Assignees

Comments

@Caceresenzo
Copy link

Hi

I have imported your libs in my apps, and do everything like the exemple, try crashing it, and the application was just frozen...

So i try with your exemple direcly, i created a new project and imported your exemple, compiled it, and was not working either...

What should i do ?
With logcat i can see that you handler has been installed and the exception has been caught, but the is just waiting, completly frozen

  • Enzo
@RohitSurwase
Copy link
Owner

Please make sure you have added dependencies to the project level build.gradle and the app level build.gradle. After that, you need to initialize UCE-Handler in your Application class's onCreate().

If you have already done this try disabling ( .setUCEHEnabled(false) ) the library and see if your app works (it should show default crash dialog).
Additionally, can you share the logs?

@RohitSurwase RohitSurwase self-assigned this Apr 29, 2018
@Caceresenzo
Copy link
Author

Caceresenzo commented Apr 29, 2018

I don't use Android Studio with Gradle, I use Eclipse Android Developement Tool

That work the shame but ADT don't support gradle, so you have to import all project yourself and say you want to add them to your project, and that work perfeclty fine

By disabling your library with .setUCEHEnabled(false), the default crash "Stopped working" message show again;

But if i remove this line, the app just froze and stay like this (it become black most of the time)

Here is logcat output of my application: (Put in pastebin, because that was not practical)
https://pastebin.com/8g5gSBLR

As you can see, your handler has been called but nothing append

And here is my Application class (defined in the AndroidManifest.xml)
image

@RohitSurwase
Copy link
Owner

So if you are using ADT, make sure after you download the project, import only "uce_handler" out of it. That's what you will need. I'll look into the logs and get back to you.

@Caceresenzo
Copy link
Author

I am already importing only the uce_handler. I even check if the libs was depending of any libs

  • Enzo

@RohitSurwase
Copy link
Owner

Are you using any other custom exception handler? or similar library for the same?
Please make sure if you are not doing something in wrong way. As apart from your app, the included example app should definitely work if used as it is.
I have even tried causing an exception (as you have) in the library but still, it is not freezing as you are experiencing.

@Caceresenzo
Copy link
Author

I am not using any other libraries

I try with your example app, because i was not understanding why that was not working
So i imported it into eclipse, add appcompat and your libraries, but the example app freeze too..

If you want i can export you your example app and you will see by yourself

I think i forgot to mention that the only difference with our 2 example compiled app, was the fact that my app used the AppTheme (i was forced to put minSdk to 21 and targetSdk to 27, otherwise eclipse wasn't compiling because he found that if no sdk information was provided, the default was 0 or 1, and throw an exception saying that this version don't support Runtime Permission)

  • Enzo

@RohitSurwase
Copy link
Owner

If you don't mind, please share the example app.
The minSdkVersion of the library is 14.

@Caceresenzo
Copy link
Author

Caceresenzo commented Apr 29, 2018

http://caceresenzo.esy.es/repo/enzo/code/test/Android.App.HandlerTest.apkx

(sorry but this host don't allow .apk file or .exe file on their site, i just rename the file extension)
(and btw, this application is not signed)

@RohitSurwase
Copy link
Owner

RohitSurwase commented Apr 29, 2018

Thanks but I was asking about the source of the example app which you have modified and not working. Share the compressed file with me.

@Caceresenzo
Copy link
Author

http://caceresenzo.esy.es/repo/enzo/code/test/Android.App.HandlerTest.7z

(the project name was Android.App.ExpandableLayoutTest or something like that, because i use this example project and remove everything and use this project for your example app (i was lazy creating a new project))

@RohitSurwase
Copy link
Owner

The source of the example app you have shared does not have the library as a module included. Please review your project setup once again. I have tested it several times with different scenarios nothing happing like yours. Another thing, a suggestion, try upgrading to Android Studio.

I am closing this issue as it is either because of wrong setup or deprecated Eclipse and APT.

@Caceresenzo
Copy link
Author

Check out the project.properties file, all libraries are here!

@RohitSurwase
Copy link
Owner

Yes, correct me if I'm wrong, you have imported the project but not the library, the library is in submodule
compile 'com.github.RohitSurwase.UCE-Handler:uce_handler:1.3'
I have not used eclipse for ages so cannot be sure.

@Caceresenzo
Copy link
Author

With eclipse, a library is a project that you need to configure "As Library", eclipse will do all the work if you tell him (with project.properties (with a GUI)) to use this libraries, the compilation will exactly do the same as android studio for the "compile 'com.github.RohitSurwase.UCE-Handler:uce_handler:1.3'" thing

Eclipse work fine with lib, just as an example, my main project depend of 12 another libraries (interpreted as independant project by eclipse)

@RohitSurwase
Copy link
Owner

RohitSurwase commented Apr 29, 2018

Okay, let me try it another way, share your main app's crash log without adding the library or disabling the library.
By the way, I still doubt why the default example is not working in your case.

@Caceresenzo
Copy link
Author

Caceresenzo commented Apr 29, 2018

I removed your library of my project, and re-add the "crash" back

my code is just when my second activity start, it throw an exception
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video); <... code ...> throw new RuntimeException(); }

so here the crahs report:
https://pastebin.com/waMrfTC4

EDIT: code seems to not format, sorry

@RohitSurwase
Copy link
Owner

It looks like your main app is causing out of memory exception because of the library. Maybe your device is not able to hold the stack trace in the memory. Try increasing the heap size temporary like largeHeap="true" And tell me the result.

@Caceresenzo
Copy link
Author

I got 2 devices, one is running android 8 (2gb ram) and the other one 5.1 (1gb ram), i have tested on both phone, and the same result occure, the app just froze...

I just added the largeHeap="true" to the android manifest but the result stay like before

  • Enzo

@RohitSurwase
Copy link
Owner

In that case no luck for both of us. I can not reproduce it on my side, different IDE environment. You are doing your best. The library is tested multiple times and also being used by many without any issues. Thanks for reporting the issue though.

@Caceresenzo
Copy link
Author

Even if the problem persist, thanks you for your time helping me!

I will try to do thing tomorow, i will come to post solution, if any, as soon as possible

@Caceresenzo
Copy link
Author

FOUND!!!!!!!!!!!!!!!!

Eclipse ADT is pretty old and not maintained, SO HERE THS FUC*ING SOLUTION:

I edit a lot your code, searching what could cause this error;
After 1 hour, i found that application.startActivitity(intent); was blocking!

Soooooooooooooooooooooooo,
Why this operation was blocking ? I tried to do the instruction in a thread and found that was because the instruction was crashing the thread again.
And the reason was simple, because Your Library Activity was NOT registered! Eclipse ADT is capable to mix R.java file, but is NOT capable (yet i think) to mix AndroidManifest.xml...

image

And it finally work! Thanks you!

But can you edit your Readme.rm to say that if the developer is using Eclipse ADT, he need to register, BY HAND, your crash report activity!

Thanks for you libs, he will be helpful!

@RohitSurwase
Copy link
Owner

Yes! Of course, I will add this suggestion to README file.
Thanks for replying your solution.
I hope soon you will start using Android Studio as your default IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants