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

app still crashes on 0.20 when pressing "stop" while playing #54

Closed
zoff99 opened this issue Jun 16, 2016 · 18 comments
Closed

app still crashes on 0.20 when pressing "stop" while playing #54

zoff99 opened this issue Jun 16, 2016 · 18 comments

Comments

@zoff99
Copy link
Contributor

zoff99 commented Jun 16, 2016

still happening on 0.20 !

@segler-alex
Copy link
Owner

i am testing this app with 4 different devices: s2, s5, fairphone 1, nexus 7
but i cannot reproduce your issue.
which device do you use?
could you provide a log?
App for displaying logs: catlog in fdroid and logcat in playstore

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 18, 2016

still the same problem, doing network stuff on main thread:

06-18 19:05:34.304: E/AndroidRuntime(13209): FATAL EXCEPTION: main
06-18 19:05:34.304: E/AndroidRuntime(13209): Process: net.programmierecke.radiodroid2, PID: 13209
06-18 19:05:34.304: E/AndroidRuntime(13209): android.os.NetworkOnMainThreadException
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147)
06-18 19:05:34.304: E/AndroidRuntime(13209): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:249)
06-18 19:05:34.304: E/AndroidRuntime(13209): at libcore.io.IoBridge.recvfrom(IoBridge.java:553)
06-18 19:05:34.304: E/AndroidRuntime(13209): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)
06-18 19:05:34.304: E/AndroidRuntime(13209): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
06-18 19:05:34.304: E/AndroidRuntime(13209): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okio.Okio$2.read(Okio.java:113)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okio.RealBufferedSource.indexOf(RealBufferedSource.java:147)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:94)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.readChunkSize(HttpConnection.java:512)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.read(HttpConnection.java:495)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okhttp.internal.Util.skipAll(Util.java:227)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:216)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.close(HttpConnection.java:540)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okio.RealBufferedSource.close(RealBufferedSource.java:198)
06-18 19:05:34.304: E/AndroidRuntime(13209): at com.android.okio.RealBufferedSource$1.close(RealBufferedSource.java:181)
06-18 19:05:34.304: E/AndroidRuntime(13209): at net.programmierecke.radiodroid2.StreamProxy.stop(StreamProxy.java:303)
06-18 19:05:34.304: E/AndroidRuntime(13209): at net.programmierecke.radiodroid2.PlayerService.Stop(PlayerService.java:473)
06-18 19:05:34.304: E/AndroidRuntime(13209): at net.programmierecke.radiodroid2.PlayerService$1.Stop(PlayerService.java:75)
06-18 19:05:34.304: E/AndroidRuntime(13209): at net.programmierecke.radiodroid2.PlayerServiceUtil.stop(PlayerServiceUtil.java:55)
06-18 19:05:34.304: E/AndroidRuntime(13209): at net.programmierecke.radiodroid2.ActivityPlayerInfo$3.onClick(ActivityPlayerInfo.java:106)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.view.View.performClick(View.java:4797)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.view.View$PerformClick.run(View.java:19899)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.os.Handler.handleCallback(Handler.java:739)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.os.Handler.dispatchMessage(Handler.java:95)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.os.Looper.loop(Looper.java:135)
06-18 19:05:34.304: E/AndroidRuntime(13209): at android.app.ActivityThread.main(ActivityThread.java:5310)

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 18, 2016

06-18 18:42:17.710: E/AndroidRuntime(12894): FATAL EXCEPTION: main
06-18 18:42:17.710: E/AndroidRuntime(12894): Process: net.programmierecke.radiodroid2, PID: 12894
06-18 18:42:17.710: E/AndroidRuntime(12894): java.lang.RuntimeException: Unable to start service net.programmierecke.radiodroid2.PlayerService@3d894437 with Intent { act=stop flg=0x10000000 cmp=net.programmierecke.radiodroid2/.PlayerService bnds=[193,413][1056,557] }: android.os.NetworkOnMainThreadException
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2956)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.app.ActivityThread.access$2200(ActivityThread.java:154)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.os.Handler.dispatchMessage(Handler.java:102)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.os.Looper.loop(Looper.java:135)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.app.ActivityThread.main(ActivityThread.java:5310)
06-18 18:42:17.710: E/AndroidRuntime(12894): at java.lang.reflect.Method.invoke(Native Method)
06-18 18:42:17.710: E/AndroidRuntime(12894): at java.lang.reflect.Method.invoke(Method.java:372)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
06-18 18:42:17.710: E/AndroidRuntime(12894): Caused by: android.os.NetworkOnMainThreadException
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147)
06-18 18:42:17.710: E/AndroidRuntime(12894): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:249)
06-18 18:42:17.710: E/AndroidRuntime(12894): at libcore.io.IoBridge.recvfrom(IoBridge.java:553)
06-18 18:42:17.710: E/AndroidRuntime(12894): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)
06-18 18:42:17.710: E/AndroidRuntime(12894): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
06-18 18:42:17.710: E/AndroidRuntime(12894): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okio.Okio$2.read(Okio.java:113)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okio.RealBufferedSource.indexOf(RealBufferedSource.java:147)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:94)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.readChunkSize(HttpConnection.java:512)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.read(HttpConnection.java:495)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okhttp.internal.Util.skipAll(Util.java:227)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:216)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.close(HttpConnection.java:540)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okio.RealBufferedSource.close(RealBufferedSource.java:198)
06-18 18:42:17.710: E/AndroidRuntime(12894): at com.android.okio.RealBufferedSource$1.close(RealBufferedSource.java:181)
06-18 18:42:17.710: E/AndroidRuntime(12894): at net.programmierecke.radiodroid2.StreamProxy.stop(StreamProxy.java:303)
06-18 18:42:17.710: E/AndroidRuntime(12894): at net.programmierecke.radiodroid2.PlayerService.Stop(PlayerService.java:473)
06-18 18:42:17.710: E/AndroidRuntime(12894): at net.programmierecke.radiodroid2.PlayerService.onStartCommand(PlayerService.java:264)
06-18 18:42:17.710: E/AndroidRuntime(12894): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2939)
06-18 18:42:17.710: E/AndroidRuntime(12894): ... 10 more

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 18, 2016

put this in your onCreate() method to find all these problems:

        ------- only after API level 9 -------
        ------- only after API level 9 -------
            try
            {
                StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyDeath().penaltyLog().build());
                StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
        
                    StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
                    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(old).permitDiskWrites().build());
                    old = StrictMode.getThreadPolicy();
                    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(old).permitDiskReads().build());
        
                }
                catch (NoClassDefFoundError e)
                {
                }
        ------- only after API level 9 -------
        ------- only after API level 9 -------

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 21, 2016

still happens on 0.20 version

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 26, 2016

any new on this? this is very bad :-(

@zoff99 zoff99 changed the title app still crashes on 0.19 when pressing "stop" while playing app still crashes on 0.20 when pressing "stop" while playing Jun 26, 2016
@segler-alex
Copy link
Owner

thank you for your help!
i still cannot reproduce this, but your Log helped a lot.
please try again in version 0.21

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 26, 2016

no problem. if it happens again i will send log again.
when will 0.21 be available on f-droid?

@segler-alex
Copy link
Owner

fdroid takes 24 hours. :(

@segler-alex
Copy link
Owner

app-release.apk.zip

@segler-alex
Copy link
Owner

that is the current build, if you check it now, i will wait with pushing to fdroid

@segler-alex
Copy link
Owner

i pushed the new build, because i got no answer

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 26, 2016

i can not test now. at home it works. but normally i use it in my car with blutooth.
when i use it in the car next time i will tell you ASAP.

thanks for your work!

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 26, 2016

0.21 works fine now. thanks!

@zoff99 zoff99 closed this as completed Jun 26, 2016
@segler-alex
Copy link
Owner

cool!

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 26, 2016

aso, du bist eh aus wien :-)

@segler-alex
Copy link
Owner

yes :) du auch?

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 27, 2016

yup. stupid that on github you can not send private messages.

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