Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Multiple Java versions #35

Closed
Oreeeee opened this issue Jul 8, 2022 · 8 comments
Closed

Multiple Java versions #35

Oreeeee opened this issue Jul 8, 2022 · 8 comments

Comments

@Oreeeee
Copy link

Oreeeee commented Jul 8, 2022

I have Java 8 (java), Java 18 (/usr/lib/jvm/java-18-openjdk/bin/java) and Zulu 18 (/usr/lib/jvm/zulu-18/bin/java) but this app checks for "java". How can I point to /usr/lib/jvm/zulu-18/bin/java?

@shamankayka
Copy link

[https://github.com/reisxd/revanced-builder/issues/35#issue-1298306810]()

@reisxd
Copy link
Owner

reisxd commented Jul 8, 2022

I have Java 8 (java), Java 18 (/usr/lib/jvm/java-18-openjdk/bin/java) and Zulu 18 (/usr/lib/jvm/zulu-18/bin/java) but this app checks for "java". How can I point to /usr/lib/jvm/zulu-18/bin/java?

I don't know linux but there should be a command that makes it use Zulu JDK 18

@jgmGit
Copy link

jgmGit commented Jul 8, 2022

@Oreeeee you can set alternatives path in linux. I had to all install this zulu sdk and set the alternative path. Then it worked. You can check this link maybe.

https://stackoverflow.com/questions/12787757/how-to-use-the-command-update-alternatives-config-java

@Oreeeee
Copy link
Author

Oreeeee commented Jul 8, 2022

@jgmGit I was able to change Java version both by modifying source code of this script and by using "archlinux-java" command, but now I get this error.

No device found! Fallback to only build.
Unhandled Rejection
Reason: TypeError: Cannot read properties of null (reading '0')
Please make an issue at https://github.com/reisxd/revanced-builder/issues.
Press any key to exit...

@bayazidbh
Copy link

Using Garuda Linux (arch) here, and I have zulu-17-bin and zulu-18-bin installed via AUR. They seem to install all the zulu files on /usr/lib/jvm/zulu-{zulu-version} folder if that's relevant.

I do manage to change the active java environment using sudo archlinux-java set zulu-* (I'd imagine .rpm/dnf based distro has its own update-java-alternatives or update-alternatives command equivalent). Trying to build with ./revanced-builder-nodejs-linux failed but using node . --patch worked although it doesn't detect my device despite adb detecting it as connected.

Here's my log:

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ archlinux-java status
Available Java environments:
java-18-openjdk (default)
zulu-17
zulu-18

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ sudo archlinux-java set zulu-17

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 29ms
$ ./revanced-builder-nodejs-linux       
Downloading latest patches, integrations and cli...
[revanced-cli-2.3.2-all.jar] ✓
[revanced-patches-2.10.2.dex] ✓
[revanced-patches-2.10.2.jar] ✓
[app-release-unsigned.apk] ✓
[microg.apk] ✓
No device found! Fallback to only build.
Unhandled Rejection
Reason: TypeError: Cannot read properties of null (reading '0')
Please make an issue at https://github.com/reisxd/revanced-builder/issues.
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 1m
$ sudo archlinux-java set zulu-18

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 19ms
$ ./revanced-builder-nodejs-linux
Downloading latest patches, integrations and cli...
[app-release-unsigned.apk] ✓
[microg.apk] ✓
No device found! Fallback to only build.
Unhandled Rejection
Reason: TypeError: Cannot read properties of null (reading '0')
Please make an issue at https://github.com/reisxd/revanced-builder/issues.
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 4ms
$ node . --patch --exclude hide-shorts-button,disable-fullscreen-panels,hide-infocard-suggestions 
Downloading latest patches, integrations and cli...
No device found! Fallback to only build.
[app-release-unsigned.apk] ✓
[microg.apk] ✓
? Select a YT version to download. 17.25.35
Downloading the YouTube APK, this'll take some time!
[youtube.apk] ✓
Download complete!
Building ReVanced, please be patient!
INFO: Decoding resources 
INFO: Reading dex files 
INFO: Merging ./revanced/app-release-unsigned.apk 
INFO: Skipping hide-infocard-suggestions: Explicitly excluded 
INFO: Skipping enable-wide-searchbar: Explicitly excluded 
INFO: Skipping disable-fullscreen-panels: Explicitly excluded
INFO: Skipping hide-shorts-button: Explicitly excluded
INFO: Skipping enable-debugging: Explicitly excluded
INFO: fenster-swipe-controls succeeded
INFO: seekbar-tapping succeeded
INFO: general-ads succeeded
INFO: video-ads succeeded
INFO: custom-branding succeeded
INFO: premium-heading succeeded
INFO: minimized-playback succeeded
INFO: old-quality-layout succeeded
INFO: hide-autoplay-button succeeded
INFO: disable-create-button succeeded
INFO: amoled succeeded
INFO: hide-cast-button succeeded
INFO: hide-watermark succeeded
INFO: microg-support succeeded
INFO: custom-playback-speed succeeded
INFO: hdr-max-brightness succeeded
INFO: Compiling resources
INFO: Writing modified dex files
INFO: Writing dex file classes2.dex
INFO: Writing dex file classes.dex
INFO: Writing dex file classes3.dex
INFO: Writing dex file classes4.dex
INFO: Writing dex file classes8.dex
INFO: Writing dex file classes6.dex
INFO: Writing dex file classes5.dex
INFO: Writing dex file classes7.dex
INFO: Writing resources...
INFO: Aligning revanced_raw.apk
INFO: Signing revanced_aligned.apk
INFO: Found existing keystore: revanced
INFO: Copying revanced_signed.apk to revanced.apk
INFO: Finished

You now can install ReVanced and MicroG by transferring revanced/revanced.apk and revaned/microg.apk!
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ adb devices
List of devices attached
RR8N4006STN     device

  bayazidbh@Garuda in repo: revanced-builder on  main [!?] is  v1.0.0 via  v16.16.0 as 🧙
$ adb install ./revanced/revanced.apk
Performing Streamed Install
Success

  bayazidbh@Garuda in repo: revanced-builder on  main [!?] is  v1.0.0 via  v16.16.0 as 🧙 took 23s
$ adb install ./revanced/microg.apk
Performing Streamed Install
Success

@reisxd
Copy link
Owner

reisxd commented Jul 9, 2022

Using Garuda Linux (arch) here, and I have zulu-17-bin and zulu-18-bin installed via AUR. They seem to install all the zulu files on /usr/lib/jvm/zulu-{zulu-version} folder if that's relevant.

I do manage to change the active java environment using sudo archlinux-java set zulu-* (I'd imagine .rpm/dnf based distro has its own update-java-alternatives or update-alternatives command equivalent). Trying to build with ./revanced-builder-nodejs-linux failed but using node . --patch worked although it doesn't detect my device despite adb detecting it as connected.

Here's my log:

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ archlinux-java status
Available Java environments:
java-18-openjdk (default)
zulu-17
zulu-18

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ sudo archlinux-java set zulu-17

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 29ms
$ ./revanced-builder-nodejs-linux       
Downloading latest patches, integrations and cli...
[revanced-cli-2.3.2-all.jar] ✓
[revanced-patches-2.10.2.dex] ✓
[revanced-patches-2.10.2.jar] ✓
[app-release-unsigned.apk] ✓
[microg.apk] ✓
No device found! Fallback to only build.
Unhandled Rejection
Reason: TypeError: Cannot read properties of null (reading '0')
Please make an issue at https://github.com/reisxd/revanced-builder/issues.
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 1m
$ sudo archlinux-java set zulu-18

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 19ms
$ ./revanced-builder-nodejs-linux
Downloading latest patches, integrations and cli...
[app-release-unsigned.apk] ✓
[microg.apk] ✓
No device found! Fallback to only build.
Unhandled Rejection
Reason: TypeError: Cannot read properties of null (reading '0')
Please make an issue at https://github.com/reisxd/revanced-builder/issues.
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 4ms
$ node . --patch --exclude hide-shorts-button,disable-fullscreen-panels,hide-infocard-suggestions 
Downloading latest patches, integrations and cli...
No device found! Fallback to only build.
[app-release-unsigned.apk] ✓
[microg.apk] ✓
? Select a YT version to download. 17.25.35
Downloading the YouTube APK, this'll take some time!
[youtube.apk] ✓
Download complete!
Building ReVanced, please be patient!
INFO: Decoding resources 
INFO: Reading dex files 
INFO: Merging ./revanced/app-release-unsigned.apk 
INFO: Skipping hide-infocard-suggestions: Explicitly excluded 
INFO: Skipping enable-wide-searchbar: Explicitly excluded 
INFO: Skipping disable-fullscreen-panels: Explicitly excluded
INFO: Skipping hide-shorts-button: Explicitly excluded
INFO: Skipping enable-debugging: Explicitly excluded
INFO: fenster-swipe-controls succeeded
INFO: seekbar-tapping succeeded
INFO: general-ads succeeded
INFO: video-ads succeeded
INFO: custom-branding succeeded
INFO: premium-heading succeeded
INFO: minimized-playback succeeded
INFO: old-quality-layout succeeded
INFO: hide-autoplay-button succeeded
INFO: disable-create-button succeeded
INFO: amoled succeeded
INFO: hide-cast-button succeeded
INFO: hide-watermark succeeded
INFO: microg-support succeeded
INFO: custom-playback-speed succeeded
INFO: hdr-max-brightness succeeded
INFO: Compiling resources
INFO: Writing modified dex files
INFO: Writing dex file classes2.dex
INFO: Writing dex file classes.dex
INFO: Writing dex file classes3.dex
INFO: Writing dex file classes4.dex
INFO: Writing dex file classes8.dex
INFO: Writing dex file classes6.dex
INFO: Writing dex file classes5.dex
INFO: Writing dex file classes7.dex
INFO: Writing resources...
INFO: Aligning revanced_raw.apk
INFO: Signing revanced_aligned.apk
INFO: Found existing keystore: revanced
INFO: Copying revanced_signed.apk to revanced.apk
INFO: Finished

You now can install ReVanced and MicroG by transferring revanced/revanced.apk and revaned/microg.apk!
Press any key to exit...

  bayazidbh@Garuda in repo: revanced-builder on  main [!] is  v1.0.0 via  v16.16.0 as 🧙 took 6ms
$ adb devices
List of devices attached
RR8N4006STN     device

  bayazidbh@Garuda in repo: revanced-builder on  main [!?] is  v1.0.0 via  v16.16.0 as 🧙
$ adb install ./revanced/revanced.apk
Performing Streamed Install
Success

  bayazidbh@Garuda in repo: revanced-builder on  main [!?] is  v1.0.0 via  v16.16.0 as 🧙 took 23s
$ adb install ./revanced/microg.apk
Performing Streamed Install
Success

The issue is known, however I need more information. (#38)

@shrihankp
Copy link
Collaborator

shrihankp commented Jul 9, 2022

@Oreeeee @bayazidbh Try using v1.2.6. The issue was most likely fixed in #40.

@reisxd reisxd closed this as completed Jul 10, 2022
@bayazidbh
Copy link

Hm, with my java env set as java-18-openjdk, it still wouldn't do it, but it's easy enough to sudo archlinux-java set zulu-18 (or its update-java-alternatives or update-alternatives equivalent on other distro) and set the correct java environment so I'd recommend just adding that to the Requirement or How To Build section.

With the right java env set, I still have the issue #47 problem with the provided revanced-builder-nodejs-linux from the releases page. But doing the manual git pull && npm install && node . --patch worked and I was able to successfully build the revanced apk.

So yeah, issues solved, just add a note about how to change java environment in case user have different java env, I suppose. Thanks for the support, though!

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

6 participants