Search code examples
antkivybuildozer

Error while building with Buildozer


I am fairly new to Kivy and Android app development. I did a basic hello world app with Kivy and was trying to make an APK from it with Buildozer. These were the errors that I see:

-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.

I don't understand where the problem is coming from. I tried specifying version from main.py but that doesn't help either. Any pointers? Thanks in advance.


Solution

  • Notification.setLatestEventInfo is removed in API Level 23 (Android 6.0): https://developer.android.com/sdk/api_diff/23/changes/android.app.Notification.html

    Here some solutions to use instead: How to implement the deprecated methods of Notification