Py4a Gradle error

59 views
Skip to first unread message

Padam Gupta

unread,
Jul 11, 2020, 5:06:00 AM7/11/20
to Kivy users support
I was trying to build a webview android application using py4a and after solving many errors, I am stuck at this gradle error.

First I run this - 
p4a apk --private /home/deviantpadam/andro/ --package=org.deviant.myapp --name "My Android" --version 0.1 --bootstrap=webview --requirements=flask,gensim,h5py,Jinja2,numpy --port=5000

and getting this - 

Listing '/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1           working:                                                        Exception in thread background thread for pid 8205:ols version to be 28.0.2
Traceback (most recent call last):> 0% INITIALIZ...(and 22 more) 
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/site-packages/sh.py", line 1662, in wrap
    fn(*args, **kwargs)
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/site-packages/sh.py", line 2606, in background_thread
    handle_exit_code(exit_code)
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/site-packages/sh.py", line 2304, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/deviantpadam/anaconda3/envs/android/lib/python3.7/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/gradlew assembleDebug

  STDOUT:

> Task :compileDebugJavaWithJavac FAILED
/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/src/main/java/org/kivy/android/PythonActivity.java:245: error: cannot find symbol
    public boolean onKeyDown(int keyCode, KeyEvent event) {
                                          ^
  symbol:   class KeyEvent
  location: class PythonActivity
/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/src/main/java/org/kivy/android/PythonActivity.java:130: error: package AlertDialog does not exist
                AlertDialog.Builder dlgAlert  = new AlertDialog.Builder(PythonActivity.mActivity);
                           ^
/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/src/main/java/org/kivy/android/PythonActivity.java:130: error: package AlertDialog does not exist
                AlertDialog.Builder dlgAlert  = new AlertDialog.Builder(PythonActivity.mActivity);
                                                               ^
/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/src/main/java/org/kivy/android/PythonActivity.java:137: error: package DialogInterface does not exist
                    new DialogInterface.OnClickListener() {
                                       ^
/home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/src/main/java/org/kivy/android/PythonActivity.java:247: error: cannot find symbol
        if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
                        ^
  symbol:   variable KeyEvent
  location: class PythonActivity
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 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

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.

BUILD FAILED in 2s
15 actionable tasks: 15 executed




  STDERR:
[INFO]:    STDOUT (last 20 lines of 47):                                       
FAILURE: Build failed with an exception.
           working: 
* 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
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.
BUILD FAILED in 2s
15 actionable tasks: 15 executed

[INFO]:    STDERR:
[INFO]:    COMMAND:
cd /home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a && /home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/gradlew assembleDebug

[WARNING]: ERROR: /home/deviantpadam/.local/share/python-for-android/dists/unnamed_dist_1__armeabi-v7a/gradlew failed!

any advice or guidance would be greatly appreciated.

Padam Gupta

unread,
Jul 12, 2020, 11:09:28 AM7/12/20
to Kivy users support
Will Downgrading gradle work? if yes, then how can I downgrade gradle?

Padam Gupta

unread,
Jul 12, 2020, 3:43:44 PM7/12/20
to Kivy users support
Update Downgraded to gradel 4.10 still getting error.
BUILD FAILED in 1s
15 actionable tasks: 1 executed, 14 up-to-date



On Saturday, July 11, 2020 at 2:36:00 PM UTC+5:30, Padam Gupta wrote:

Padam Gupta

unread,
Jul 14, 2020, 9:33:46 AM7/14/20
to Kivy users support
Update2- Solved all issues and build apk successfully.
But after installing the app, app is stuck at Loading... after Kivy loading screen.
Now what is this, can anyone explain?
Reply all
Reply to author
Forward
0 new messages