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

How to build locally? #282

Open
brian200508 opened this issue Jan 14, 2024 · 3 comments
Open

How to build locally? #282

brian200508 opened this issue Jan 14, 2024 · 3 comments

Comments

@brian200508
Copy link

Hello,

how can I build VHEditor locally on Windows 11? I tried the following steps:

  • create fork, checked out locally with recursion
  • install JDK 17 (with setting JAVA_HOME)
  • install Node.JS 20
  • install Android CLI Tools
    • (with setting ANDROID_HOME to basedir of CLI (e.g. C:\ProgramFiles\Android-SDK) and adding bin folder (e.g. C:\ProgramFiles\Android-SDK\cmdline-tools\latest\bin) to PATH - use Path without blanks/spaces!!!
    • see https://developer.android.com/tools/sdkmanager
gradlew.bat
npm i [email protected]
  • install NDK; You may have to run the following commands with Administrator privileges and accept all licenses with y
sdkmanager --install ndk;23.2.8568313
sdkmanager --install cmake;3.18.1
sdkmanager --install platforms;android-23
sdkmanager --install platforms;android-33
sdkmanager --install build-tools;30.0.3
sdkmanager --install build-tools;33.0.0
sdkmanager --install tools
sdkmanager --install platform-tools
sdkmanager --install emulator
gradlew.bat
  • fix build in node_modules\react-native-os\android\build.gradle: replace compile by implementation in dependencies section; retry with gradlew.bat
  • fix build in node_modules\react-native-tcp\android\build.gradle: replace compile by implementation in dependencies section; retry with gradlew.bat
  • fix build in node_modules\react-native-udp\android\build.gradle: replace compile by implementation in dependencies section; retry with gradlew.bat
  • build
gradlew.bat clean
gradlew.bat build
  • in case of Override related build errors comment out Override annotations (example: node_modules\react-native-os\android\src\main\java\com\peel\react\RNOSModule.java:31 ):
    //@Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

But I still get compile and deprecation issues. What I am doing wrong? Is there any build documentation?

Best Regards
Brian

@brian200508
Copy link
Author

@Nullable Annotations are unknown; for example:

> Configure project :termux-shared
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
WARNING:The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.3.1.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :react-native-udp:compileDebugJavaWithJavac
C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSocketClient.java:11: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSockets.java:12: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSocketClient.java:71: error: cannot find symbol
    public void bind(Integer port, @Nullable String address) throws IOException {
                                    ^
  symbol:   class Nullable
  location: class UdpSocketClient
C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSocketClient.java:132: error: cannot find symbol
    public void send(String base64String, Integer port, String address, @Nullable Callback callback)
                                                                         ^
  symbol:   class Nullable
  location: class UdpSocketClient
C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSockets.java:128: error: cannot find symbol
    public void bind(final Integer cId, final Integer port, final @Nullable String address,      
                                                                   ^
  symbol:   class Nullable
  location: class UdpSockets
Note: C:\Users\brian\Develop\VHEditor-Android\node_modules\react-native-udp\android\src\main\java\com\tradle\react\UdpSockets.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

@HGRgamer
Copy link
Contributor

Not sure if I am helpful but why don't you just fork it and run workflow ?
In case you want it to be private just create an empty repo and upload files

Anyway you may find something helpful here
https://github.com/vhqtvn/VHEditor-Android/blob/master/.github/workflows/build-android.yaml

@brian200508
Copy link
Author

Thanks for Your hint. It works with GitHub Actions when using the current VHEditor release (2.15.1 from June 2023).
Yes, and the APK built was installable and runnable without any errors.

But I do not get it to compile the code-server v4.91.1 zips. Currently I am lost with compile issues for intermediate artifacts like sqlite3 I cannot find in the Git repo (or submodules). My last attempt was https://github.com/brian200508/vscode-android-server/actions/runs/10451562111.

I am trying to migrate to NodeJS 20.16.0 running on an Ubuntu 22.04 docker container with Python 3.10, ndk25.2.9519653, sdk33.

Are there any intentions to update VHEditor/code-server to a recent version (e.g. v4.91.1 or v4.92.x)?
Maybe you can use my pre-work from

https://github.com/brian200508/vscode-android-server/tree/master-brian200508-update-code-sever

Best Regards
Brian

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