Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

(Solved) release build - null exception #18

Open
hhyeok1026 opened this issue Apr 17, 2020 · 2 comments
Open

(Solved) release build - null exception #18

hhyeok1026 opened this issue Apr 17, 2020 · 2 comments

Comments

@hhyeok1026
Copy link
Contributor

hhyeok1026 commented Apr 17, 2020

I put this library in my project and i succeeded in extracting the video.

However, in the release version, there was a problem with extraction.

If you use minifyEnabled true in build.gradle you will get a problem that the problem is not working.

YoutubeStreamExtractor.class

private PlayerResponse parseJson (String body) throws Exception {
JsonParser parser = new JsonParser ();
response = new GsonBuilder (). serializeNulls (). create (). fromJson (parser.parse (body), Response.class);
return new GsonBuilder (). serializeNulls (). create (). fromJson (response.getArgs (). getPlayerResponse (), PlayerResponse.class);
}

In the return statement, null exception occurs.

Solution1: Write a ProGuard exception.

in the proguard-rules.pro file
-keep class com.yourcompany.naveedhassan913_youtubeextractor_test. ** {*; }
(Please correct accordingly)

After writing as above,
Rebuild the source and run it.

After that you will also get an error.
If there is an exception that occurs in the dechiperSig () method of CipherManager.class,

Solution2
Write this in the proguard-rules.pro file as follows.
-keep class org.mozilla.javascript. ** {*; }
(For dependency org.mozilla: rhino: 1.7R4 to work properly)

I have tried several things to solve this,
This may not be the exact solution.

If you don't understand this or don't work properly, let me know.

Additionally
I haven't solved this problem.

when i use minifyEnabled true,
there is R8 warnings in build output.
Let me know if you know the solution.

image

I respects the library owner.
Thank you.

@nhCoder
Copy link
Owner

nhCoder commented Apr 19, 2020

Thanks for the solution though, As i mentioned on readme top that I build this lib using AIDE on Android... It doesn't support full gradle and Proguard.. Thats y it shows no errors to me.....

@hhyeok1026
Copy link
Contributor Author

@naveedhassan913
yes, I read the readme.
Perhaps anyone who wants to use this will use Android Studio.

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

No branches or pull requests

2 participants