使用 Buildozer 构建时出错

Error while building with Buildozer

我对 Kivy 和 Android 应用程序开发还很陌生。我用 Kivy 做了一个基本的 hello world 应用程序,并试图用 Buildozer 从中制作一个 APK。这些是我看到的错误:

-compile:
[javac] Compiling 11 source files to /home/ratul/Devel/Python/Kivy/test/.buildozer/android/platform/python-for-android/dist/ratulsapp/bin/classes
[javac] /home/ratul/Devel/Python/Kivy/test/.buildozer/android/platform/python-for-android/dist/ratulsapp/src/org/renpy/android/PythonService.java:64: error: cannot find symbol
[javac]         notification.setLatestEventInfo(context, serviceTitle, serviceDescription, pIntent);
[javac]                     ^
[javac]   symbol:   method setLatestEventInfo(Context,String,String,PendingIntent)
[javac]   location: variable notification of type Notification
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error

BUILD FAILED
/home/ratul/Devel/Android/Sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/home/ratul/Devel/Android/Sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.

我不明白问题出在哪里。我尝试从 main.py 指定 version 但这也无济于事。任何指针?提前致谢。

Notification.setLatestEventInfo 在 API 级别 23 (Android 6.0) 中被删除: https://developer.android.com/sdk/api_diff/23/changes/android.app.Notification.html

这里可以使用一些解决方案:How to implement the deprecated methods of Notification