Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

package org.python does not exist #917

Open
diyseguy opened this issue Sep 5, 2018 · 1 comment
Open

package org.python does not exist #917

diyseguy opened this issue Sep 5, 2018 · 1 comment

Comments

@diyseguy
Copy link

diyseguy commented Sep 5, 2018

Want this to work as I much prefer working in Python, but I realize this is still all in alpha

Anyway, working through the setup and tutorial
(note I already tried downgrading all the toga packages to various 'dev?' versions)
I am on MacOSX, I have installed Android Studio and Android SDK No. 15
I installed jython via the executable jar downloaded from jython.org
I have set these env variables:

ANDROID_HOME=/Users/foo/Library/Android/sdk
ANDROID_SDK_HOME=/Users/foo/Library/Android/sdk
CLASSPATH=:/Users/foo/jython2.7.0/javalib/
JYTHON_HOME=/Users/foo/jython2.7.0/
JYTHON_PATH=/Users/foo/jython2.7.0/bin
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
PATH=/Users/foo/src/pybee/tutorial/venv/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/foo/Library/Android/sdk/tools:/Users/foo/Library/Android/sdk/platform-tools:/Users/foo/Library/Android/sdk/tools/bin:/Users/foo/jython2.7.0/bin:/Users/foo/Library/Android/sdk/platform-tools/

Here is the status of pip freeze:

arrow==0.12.1
binaryornot==0.4.4
boto3==1.8.7
botocore==1.11.7
briefcase==0.2.6
certifi==2018.8.24
chardet==3.0.4
click==6.7
colosseum==0.1.6
cookiecutter==1.6.0
Django==1.10.6
django-environ==0.4.1
docutils==0.14
future==0.16.0
idna==2.7
Jinja2==2.10
jinja2-time==0.2.0
jmespath==0.9.3
MarkupSafe==1.0
poyo==0.4.1
python-dateutil==2.7.3
requests==2.19.1
rubicon-objc==0.3.0
s3transfer==0.1.13
six==1.11.0
toga==0.3.0.dev9
toga-cocoa==0.3.0.dev9
toga-core==0.3.0.dev9
toga-django==0.3.0.dev9
travertino==0.1.2
urllib3==1.23
voc==0.1.5
whichcraft==0.4.1

Running:

python setup.py android -s

gives:

python setup.py android -s 
running android

 * Updating user code...
 * Installing requirements...
No requirements.
 * Installing platform requirements...
Collecting toga-android==0.3.0.dev9
  Using cached https://files.pythonhosted.org/packages/34/7d/444f07d35d0f0c9b4e394003548b9100b8cac937c44406646f31b9dd30de/toga_android-0.3.0.dev9-py3-none-any.whl
Collecting toga-core==0.3.0.dev9 (from toga-android==0.3.0.dev9)
  Using cached https://files.pythonhosted.org/packages/50/a1/ebc3b57145b03b644cc53c2693838eb3afafdb686eec2dffd90cf3548d09/toga_core-0.3.0.dev9-py3-none-any.whl
Collecting travertino>=0.1.0 (from toga-core==0.3.0.dev9->toga-android==0.3.0.dev9)
  Using cached https://files.pythonhosted.org/packages/56/3f/f03efe63c2bdc72763ac39777c9ebbab98605ced5c74aefe48b4fa0abb4d/travertino-0.1.2-py3-none-any.whl
Installing collected packages: travertino, toga-core, toga-android
Successfully installed toga-android-0.3.0.dev9 toga-core-0.3.0.dev9 travertino-0.1.2
 * Installing project code...
Processing /Users/foo/src/pybee/tutorial/foo
Building wheels for collected packages: foo
  Running setup.py bdist_wheel for foo ... done
  Stored in directory: /private/var/folders/1c/1qj0qxz12hsd9vv12cwqt52c0000gn/T/pip-ephem-wheel-cache-c2zw19d_/wheels/65/6d/ba/b02dea699a7a4bd5291fd0a9aa06d2cfa4cf374357282bc1b8
Successfully built foo
Installing collected packages: foo
Successfully installed foo-0.0.1
 * No icons defined - using default...
 * No splash screen defined...

Installation complete.

Starting Foo
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_31u9w8uw06fomdcszurr6ar53.run(/Users/foo/src/pybee/tutorial/foo/android/build.gradle:11)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2511Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72511Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2511Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2511Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2511Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2511Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2511Library UP-TO-DATE
:prepareComAndroidSupportSupportV42511Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2511Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:12: error: package org.python does not exist
    static org.python.Object _listener;
                     ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:19: error: package org.python does not exist
    static public android.app.Activity setListener(org.python.Object listener) {
                                                             ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:91: error: package org.python does not exist
                org.python.Object [] args,
                          ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:92: error: package org.python does not exist
                java.util.Map<java.lang.String, org.python.Object> kwargs
                                                          ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:55: error: package org.python.java does not exist
                _listener.__setattr_null("_impl", new org.python.java.Object(this));
                                                                     ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:74: error: package org.python.exceptions does not exist
                throw (org.python.exceptions.BaseException) e.getCause();
                                            ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:80: error: package org.python.exceptions does not exist
                throw new org.python.exceptions.RuntimeError(message);
                                               ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:100: error: package org.python does not exist
                org.python.Object method = _listener.__getattribute_null(method_name);
                          ^
/Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java:102: error: package org.python does not exist
                    ((org.python.Callable) method).invoke(args, kwargs);
                                ^
Note: /Users/foo/src/pybee/tutorial/foo/android/src/android/PythonActivity.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
:compileDebugJavaWithJavac FAILED

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.

BUILD FAILED

Total time: 1.189 secs
    $ adb logcat Python:* *:E

App started.

Thanks for clues and Godspeed

@k3rpo
Copy link

k3rpo commented Mar 15, 2020

Got exactly the same problem, did u solve this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants