Skip to content

p4a apk :compileDebugJavaWithJavac error #1980

@Daemonceltics

Description

@Daemonceltics

Versions

  • Python:3.5
  • OS:Ubuntu 16.04
  • Kivy:1.11.1
  • Cython:0.29.13
Installed packages:=====================] 100% Computing updates...
  Path                 | Version | Description                    | Location
  -------              | ------- | -------                        | -------
  build-tools;29.0.0   | 29.0.0  | Android SDK Build-Tools 29     | build-tools/29.0.0/
  build-tools;29.0.2   | 29.0.2  | Android SDK Build-Tools 29.0.2 | build-tools/29.0.2/
  platform-tools       | 29.0.2  | Android SDK Platform-Tools     | platform-tools/
  platforms;android-25 | 3       | Android SDK Platform 25        | platforms/android-25/
  platforms;android-26 | 2       | Android SDK Platform 26        | platforms/android-26/
  tools                | 26.1.1  | Android SDK Tools 26.1.1       | tools/

Description

p4a apk packaging error , maybe I need install something?

buildozer.spec

Command:

p4a apk --private /path/app --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy

Logs

Listing '/home/user/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages/usr/local'...
Listing '/home/user/.local/share/python-for-android/dists/unnamed_dist_2/_python_bundle/_python_bundle/site-packages/usr/local/bin'...
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
[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 29.0.2
[INFO]:        Build<-------------> 0% CONFIGURING [0s]le is present
           working:                                                                                                                                                                                                  Exception in thread background thread for pid 23607:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.5/dist-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.5/dist-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /home/user/.local/share/python-for-android/dists/unnamed_dist_2/gradlew assembleDebug

  STDOUT:

> Task :compileDebugJavaWithJavac FAILED
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/kivy/android/PythonService.java:23: error: cannot find symbol
import android.app.NotificationChannel;
                  ^
  symbol:   class NotificationChannel
  location: package android.app
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/kivy/android/PythonService.java:103: error: cannot find symbol
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
                                                       ^
  symbol:   variable O
  location: class VERSION_CODES
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/kivy/android/PythonService.java:120: error: cannot find symbol
            NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName,
            ^
  symbol:   class NotificationChannel
  location: class PythonService
/home/dcharles/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/kivy/android/PythonService.java:120: error: cannot find symbol
            NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName,
                                           ^
  symbol:   class NotificationChannel
  location: class PythonService
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/kivy/android/PythonService.java:128: error: constructor Builder in class Builder cannot be applied to given types;
            Notification.Builder builder = new Notification.Builder(context, NOTIFICATION_CHANNEL_ID);
                                           ^
  required: Context
  found: Context,String
  reason: actual and formal argument lists differ in length
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/libsdl/app/SDLControllerManager.java:435: error: cannot find symbol
                haptic.vib.vibrate(VibrationEffect.createOneShot(length, vibeValue));
                                   ^
  symbol:   variable VibrationEffect
  location: class SDLHapticHandler_API26
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/libsdl/app/SDLControllerManager.java:768: error: cannot find symbol
            case InputDevice.SOURCE_MOUSE_RELATIVE:
                            ^
  symbol:   variable SOURCE_MOUSE_RELATIVE
  location: class InputDevice
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/libsdl/app/SDLControllerManager.java:813: error: cannot find symbol
                SDLActivity.getContentView().requestPointerCapture();
                                            ^
  symbol:   method requestPointerCapture()
  location: class View
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/libsdl/app/SDLControllerManager.java:816: error: cannot find symbol
                SDLActivity.getContentView().releasePointerCapture();
                                            ^
  symbol:   method releasePointerCapture()
  location: class View
/home/user/.local/share/python-for-android/dists/unnamed_dist_2/src/main/java/org/libsdl/app/SDLControllerManager.java:831: error: cannot find symbol
            SDLActivity.getContentView().requestPointerCapture();
                                        ^
  symbol:   method requestPointerCapture()
  location: class View
Note: Some input files use or override 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.
10 errors


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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

BUILD FAILED in 1s
15 actionable tasks: 5 executed, 10 up-to-date




  STDERR:
[INFO]:    STDOUT (last 20 lines of 78):
	Note: Recompile with -Xlint:unchecked for details.
10 errors  working:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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

BUILD FAILED in 1s
15 actionable tasks: 5 executed, 10 up-to-date

[INFO]:    STDERR:

[INFO]:    COMMAND:
cd /home/user/.local/share/python-for-android/dists/unnamed_dist_2 && /home/user/.local/share/python-for-android/dists/unnamed_dist_2/gradlew assembleDebug

[WARNING]: ERROR: /home/user/.local/share/python-for-android/dists/unnamed_dist_2/gradlew failed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions