简体   繁体   English

使用 buildozer 为 kivy 项目构建 apk 文件时 Gradle 的问题

[英]Problem with Graddle when building apk file for kivy project using buildozer

I have a kivy project, and I was able to build the apk with buildozer in the end of August.我有一个 kivy 项目,8 月底我能够用 buildozer 构建 apk。 Now, when I tried to build it again, I found a problem with build.现在,当我再次尝试构建它时,我发现构建有问题。 Here is the output of the build:这是构建的输出:

Detected highest available build tools version to be 30.0.2
[DEBUG]:   -> running gradlew assembleDebug
[DEBUG]:    > Task :packageDebug FAILED
[DEBUG]:    
[DEBUG]:    FAILURE: Build failed with an exception.
[DEBUG]:    
[DEBUG]:    * What went wrong:
[DEBUG]:    Execution failed for task ':packageDebug'.
[DEBUG]:    > Java heap space
[DEBUG]:    
[DEBUG]:    * Try:
[DEBUG]:    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[DEBUG]:    
[DEBUG]:    * Get more help at https://help.gradle.org
[DEBUG]:    
[DEBUG]:    Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[DEBUG]:    Use '--warning-mode all' to show the individual deprecation warnings.
[DEBUG]:    See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings
[DEBUG]:    
[DEBUG]:    BUILD FAILED in 2s
[DEBUG]:    27 actionable tasks: 4 executed, 23 up-to-date
[DEBUG]:    
[DEBUG]:    
Exception in thread background thread for pid 119231:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/sh-1.13.1-py3.8.egg/sh.py", line 1662, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/sh-1.13.1-py3.8.egg/sh.py", line 2606, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.8/dist-packages/sh-1.13.1-py3.8.egg/sh.py", line 2304, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.8/dist-packages/sh-1.13.1-py3.8.egg/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/evgeny/spdu/kivy/game/crystal-game/.buildozer/android/platform/build-arm64-v8a/dists/myapp__arm64-v8a/gradlew assembleDebug

  STDOUT:
> Task :packageDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':packageDebug'.
> Java heap space

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
27 actionable tasks: 4 executed, 23 up-to-date





[INFO]:    STDOUT (last 20 lines of 24):
[DEBUG]:FAILURE: Build failed with an exception.    
    
* What went wrong:  
Execution failed for task ':packageDebug'.  
> Java heap space   
    
* Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.    
    
* Get more help at https://help.gradle.org  
    
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. 
Use '--warning-mode all' to show the individual deprecation warnings.   
See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings   
    
BUILD FAILED in 2s  
27 actionable tasks: 4 executed, 23 up-to-date  

[INFO]:    STDERR:
    
[INFO]:    COMMAND:
cd /home/evgeny/spdu/kivy/game/crystal-game/.buildozer/android/platform/build-arm64-v8a/dists/myapp__arm64-v8a && /home/evgeny/spdu/kivy/game/crystal-game/.buildozer/android/platform/build-arm64-v8a/dists/myapp__arm64-v8a/gradlew assembleDebug

[WARNING]: ERROR: /home/evgeny/spdu/kivy/game/crystal-game/.buildozer/android/platform/build-arm64-v8a/dists/myapp__arm64-v8a/gradlew failed!
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
Warning: failed to apply patch (exit code 1), assuming it is already applied:  src/patches/SDLActivity.java.patch

I haven't changed anything in build, it just doesn't work now, so, T don't now how to fix it.我在构建中没有改变任何东西,它现在不起作用,所以,现在不知道如何修复它。 Tried to find anything on the internet, but haven't found any solutions, hope to get some advice here.试图在互联网上找到任何东西,但没有找到任何解决方案,希望在这里得到一些建议。

Problem was in size of resources which I used in my build.问题在于我在构建中使用的资源大小。 I had some wav files weighing about 60Mb.我有一些重约 60Mb 的 wav 文件。 After reducig their size, the problem disappeared.减小它们的大小后,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM