shkcodes / Lyrically

A lyrics app which works everywhere!
MIT License
88 stars 22 forks source link

Unable to fetch lyrics. #29

Closed Limon93 closed 7 years ago

Limon93 commented 7 years ago

Hi shkcodes, i want to say thanks for this really good project, i used your app for more than 6 months. The app crashes when i open the panel and when i try to download all lyrics. It seems to be a problem related to the requests made to obtain lyrics. I tried different phones and android version but i got same results everywere. Did you got the same problem?

shkcodes commented 7 years ago

Yes it hasn't been working for me with Spotify. I am looking into a solution, expect an update soon.

It still works perfectly with offline mp3s though. Were you trying it with Spotify?

On Jun 15, 2017 21:49, "Limon93" notifications@github.com wrote:

Hi shkcodes, i want to say thanks for this really good project, i used your app for more than 6 months. The app crashes when i open the panel and when i try to download all lyrics. It seems to be a problem related to the requests made to obtain lyrics. I tried different phones and android version but i got same results everywere. Did you got the same problem?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shkcodes/Lyrically/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/APq02zyWUuPARwsp6glEjYuRxNZl5fZEks5sEVmdgaJpZM4N7cWe .

Limon93 commented 7 years ago

Doesn't work even with stock player (probably you are reading cached lyrics), i tried so many times, thanks for your time.

Limon93 commented 7 years ago

I tried to change google url il FetchLyrics.java, no more crashes. Using google.it does not work, but does not crash. Then i decided to see debug messages from android studio using your original code, i got this: 06-15 22:00:29.509 10927-10927/com.shkmishra.lyrically I/art: Late-enabling -Xcheck:jni 06-15 22:00:29.542 10927-10927/com.shkmishra.lyrically D/TidaProvider: TidaProvider() 06-15 22:00:29.547 10927-10927/com.shkmishra.lyrically V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[]) 06-15 22:00:29.547 10927-10927/com.shkmishra.lyrically V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease() 06-15 22:00:29.547 10927-10927/com.shkmishra.lyrically V/BoostFramework: mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[]) 06-15 22:00:29.547 10927-10927/com.shkmishra.lyrically V/BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String) 06-15 22:00:29.547 10927-10927/com.shkmishra.lyrically V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop() 06-15 22:00:29.550 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@52e5c1e 06-15 22:00:29.581 10927-10927/com.shkmishra.lyrically W/System: ClassLoader referenced unknown path: /data/app/com.shkmishra.lyrically-2/lib/arm64 06-15 22:00:29.636 10927-10927/com.shkmishra.lyrically I/InstantRun: Instant Run Runtime started. Android package is com.shkmishra.lyrically, real application class is null. 06-15 22:00:30.228 10927-10927/com.shkmishra.lyrically W/System: ClassLoader referenced unknown path: /data/app/com.shkmishra.lyrically-2/lib/arm64 06-15 22:00:30.998 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@4d8163 06-15 22:00:30.999 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@3fe7160 06-15 22:00:31.012 10927-10927/com.shkmishra.lyrically W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 06-15 22:00:31.213 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@ab35c4c 06-15 22:00:31.214 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@345a495 06-15 22:00:31.229 10927-11029/com.shkmishra.lyrically D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 06-15 22:00:31.252 10927-10927/com.shkmishra.lyrically D/ActivityThreadInjector: clearCachedDrawables. 06-15 22:00:31.277 10927-11029/com.shkmishra.lyrically I/Adreno: QUALCOMM build : 0a3bdfc, Ifb508eebcd Build Date : 08/04/16 OpenGL ES Shader Compiler Version: XE031.09.00.03 Local Branch : Remote Branch : Remote Branch : Reconstruct Branch : 06-15 22:00:31.281 10927-11029/com.shkmishra.lyrically I/OpenGLRenderer: Initialized EGL, version 1.4 06-15 22:00:33.189 10927-10927/com.shkmishra.lyrically I/Timeline: Timeline: Activity_launch_request time:18525040 06-15 22:00:33.254 10927-11029/com.shkmishra.lyrically D/OpenGLRenderer: endAllStagingAnimators on 0x7f98e30800 (RippleDrawable) with handle 0x7f99289620 06-15 22:01:00.044 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@6bda7d6 06-15 22:01:00.086 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@54dc936 06-15 22:01:00.086 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@b315037 06-15 22:01:00.122 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@f8fb940 06-15 22:01:00.122 10927-10927/com.shkmishra.lyrically V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@2239079 06-15 22:01:01.165 10927-11108/com.shkmishra.lyrically I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor 06-15 22:01:07.712 10927-11108/com.shkmishra.lyrically E/AndroidRuntime: FATAL EXCEPTION: IntentService[FetchLyrics] Process: com.shkmishra.lyrically, PID: 10927 java.lang.StringIndexOutOfBoundsException: length=2308; regionStart=0; regionLength=-1 at java.lang.String.startEndAndLength(String.java:298) at java.lang.String.substring(String.java:1087) at com.shkmishra.lyrically.FetchLyrics.getLyrics(FetchLyrics.java:103) at com.shkmishra.lyrically.FetchLyrics.onHandleIntent(FetchLyrics.java:49) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java) at android.os.Handler.dispatchMessage(Handler.java) at android.os.Looper.loop(Looper.java) at android.os.HandlerThread.run(HandlerThread.java)

Limon93 commented 7 years ago

I isolated Genius part and stopped crashing instantly with your original code, probably their pages have changed. App can now download some lyrics, but occasionally crashes, i suggest problems with other providers.

Limon93 commented 7 years ago

Sorry for the Close/Open Issue, my fault.

Limon93 commented 7 years ago

Oh, i noticed in LyricsService.java a repetition of lyrics fetching, isolating genius even there solves all the crashes.

Limon93 commented 7 years ago

Okay, i found the problem, when you select html part from genius you stop at </lyrics> the problem is that string is missing from newer pages of genius, i checked to be sure with cached genius pages. the solution is simple as replacing </lyrics> with <!--/sse--> (the nearest recurring block after lyrics), all problems solved. I'll try a merge request, i never done it. Whitout the correct stop the app ends up storing a too long string and crashes.

shkcodes commented 7 years ago

Thanks a LOT dude! I was going to look into it today but it seems like you have it all figured out. I will wait for your pull request.

Limon93 commented 7 years ago

Please wait for the upgrade, i'm translating the app for my language.

Limon93 commented 7 years ago

Thank you, we can close this issue, for future problems i'll be there :)