vhqtvn/VHEditor-Android

How to build locally?

brian200508 opened this issue · 2 comments

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 react-native@0.71.15
  • 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

@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