“对于zip文件的CEN和END部分,mmap失败” &&“错误:无法找到或加载主类org.gradle.wrapper.GradleWrapperMain”

时间:2018-10-21 13:23:17

标签: compiler-errors android-gradle debian build.gradle docker-machine

我尝试使用Fedora来宾环境从Debian 8 Jessie主机和Docker构建Dual Boot Patcher Android应用的apk,但是当我执行“ make apk”时遇到错误:

mmap failed for CEN and END part of zip file
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
make[3]: *** [Android_GUI/CMakeFiles/apk.dir/build.make:57: Android_GUI/CMakeFiles/apk] Error 1
make[2]: *** [CMakeFiles/Makefile2:710: Android_GUI/CMakeFiles/apk.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:717: Android_GUI/CMakeFiles/apk.dir/rule] Error 2
make: *** [Makefile:301: apk] Error 2

构建说明在这里: https://github.com/chenxiaolong/DualBootPatcher/tree/master/docs/build https://github.com/chenxiaolong/DualBootPatcher/blob/master/docs/build/Git-Clone.md https://github.com/chenxiaolong/DualBootPatcher/blob/master/docs/build/Docker.md https://github.com/chenxiaolong/DualBootPatcher/blob/master/docs/build/App-Android.md

我在Debian服务器上执行了以下命令:

# *** Build DualBootPatcher from beginning under Debian Linux within Docker environment ***


mkdir ~/git
cd ~/git


git clone --recursive https://github.com/chenxiaolong/DualBootPatcher.git


git submodule update --init --recursive


./docker/generate.sh


./docker/build.sh


docker run --rm -it \
    -e USER_ID=$(id -u) \
    -e GROUP_ID=$(id -g) \
    -v "$(pwd):/builder/DualBootPatcher:rw,z" \
    -v "${HOME}/.android:/builder/.android:rw,z" \
    -v "${HOME}/.ccache:/builder/.ccache:rw,z" \
    -v "${HOME}/.gradle:/builder/.gradle:rw,z" \
    chenxiaolong/dualbootpatcher:9.3.0-6-android \
    bash


keytool -genkey -v \
                -keystore /root/.android/debug.keystore \
                -alias androiddebugkey \
                -storepass android \
                -keypass android \
                -keyalg RSA \
                -validity 10950 \
                -dname "CN=Android Debug,O=Android,C=US"


keytool -importkeystore -srckeystore /root/.android/debug.keystore -destkeystore /root/.android/debug.keystore -deststoretype pkcs12


mkdir /builder/DualBootPatcher/build || cd /builder/DualBootPatcher/build && cmake .. -DMBP_BUILD_TARGET=android 



# Build the system components. This includes things like mbtool, odinupdater, and various native libraries used by the app. The build can be sped up by running things in parallel. Just pass -j<number of cores> (eg. -j4) to make.
make -j10


# Package the system components into a tarball.
rm -rf assets && cpack


# Build the APK. The resulting APK file will be in the Android_GUI/build/outputs/apk directory.
make apk



# *** Build DualBootPatcher from beginning under Linux within Docker environment ***

mkdir ~/git


cd ~/git


git clone --recursive https://github.com/chenxiaolong/DualBootPatcher.git


git submodule update --init --recursive


./docker/generate.sh


./docker/build.sh


docker run --rm -it \
    -e USER_ID=$(id -u) \
    -e GROUP_ID=$(id -g) \
    -v "$(pwd):/builder/DualBootPatcher:rw,z" \
    -v "${HOME}/.android:/builder/.android:rw,z" \
    -v "${HOME}/.ccache:/builder/.ccache:rw,z" \
    -v "${HOME}/.gradle:/builder/.gradle:rw,z" \
    chenxiaolong/dualbootpatcher:9.3.0-6-android \
    bash


keytool -genkey -v \
                -keystore /root/.android/debug.keystore \
                -alias androiddebugkey \
                -storepass android \
                -keypass android \
                -keyalg RSA \
                -validity 10950 \
                -dname "CN=Android Debug,O=Android,C=US"


keytool -importkeystore -srckeystore /root/.android/debug.keystore -destkeystore /root/.android/debug.keystore -deststoretype pkcs12


mkdir /builder/DualBootPatcher/build || cd /builder/DualBootPatcher/build && cmake .. -DMBP_BUILD_TARGET=android 


# Build the system components. This includes things like mbtool, odinupdater, and various native libraries used by the app. The build can be sped up by running things in parallel. Just pass -j<number of cores> (eg. -j4) to make.
make -j10


# Package the system components into a tarball.
rm -rf assets && cpack


# Build the APK. The resulting APK file will be in the Android_GUI/build/outputs/apk directory.
make apk


[root@465d02ff230d build]# make apk
mmap failed for CEN and END part of zip file
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
make[3]: *** [Android_GUI/CMakeFiles/apk.dir/build.make:57: Android_GUI/CMakeFiles/apk] Error 1
make[2]: *** [CMakeFiles/Makefile2:710: Android_GUI/CMakeFiles/apk.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:717: Android_GUI/CMakeFiles/apk.dir/rule] Error 2
make: *** [Makefile:301: apk] Error 2

我该如何解决?

0 个答案:

没有答案