I am trying to make a Bluetooth app with Kivy so I need to use java classes, I get this error message when I use Pyjnius
Traceback (most recent call last):
File "C:\Users\Omer Akbas\Desktop\My Apps (Kivy)\First\main.py", line 3, in
<module>
BluetoothAdapter = autoclass('android.bluetooth.BluetoothAdapter')
File "C:\Python27\lib\site-packages\jnius\reflect.py", line 158, in
autoclass
c = find_javaclass(clsname)
File "jnius\jnius_export_func.pxi", line 25, in jnius.find_javaclass
JavaException: Class not found 'android/bluetooth/BluetoothAdapter'
If you're building a Kivy app, pyjnius is installed in the APK automatically as a dependency of Kivy, so you don't have to do anything special beyond the normal Programming Guide ยป Create a package for Android documentation.
Related
Here's my log:
File "/home/foo/bar/revmob/__init__.py", line 11, in <module>
from android import *
File "/home/foo/bar/android.py", line 5, in <module>
RevMobNative = autoclass('com.revmob.RevMob')
File "/usr/local/lib/python3.4/dist-packages/jnius-1.1_dev-py3.4-linux-x86_64.egg/jnius/reflect.py", line 154, in autoclass
c = find_javaclass(clsname)
File "jnius/jnius_export_func.pxi", line 25, in jnius.find_javaclass (jnius/jnius.c:16506)
jnius.JavaException: Class not found b'com/revmob/RevMob'
Does anyone know where this class is in the RevMob files and where I need to put it for jnius to find it? I'm assuming it's just in the wrong location, but I'm not a Java guy.
Turns out it has to be compiled for RevMob to run. Once I'd built it with Buildozer there were no problems. This means you can't use the Kivy Launcher to test apps with RevMob ads.
I am trying to use python's charting library from my java project using jython. In my script I use module cairo.
pythonInterpreter.exec("import sys");
pythonInterpreter.exec("import cairo");
Exception throws on the second line, because cairo's init.py contains string:
from _cairo import *
The exception I get is:
Caused by: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/cairo/__init__.py", line 1, in <module>
from _cairo import *
ImportError: No module named _cairo
Also, I can use my script from console, so I doubt that it has an error in it. I suppose something is wrong with the way I'm importing cairo in Java.
I got it now. Jython can't execute 'native' libraries, such as cairo (I'm, sure it's native, because _cairo is a .so file, which means it's a C lib)
I tried to set up the Reddit API in Linux Mint 16, so that I can use it in IntelliJ 13.1.2/Java.
So I used this guide: https://github.com/reddit/reddit/wiki/Install-guide
and started with
$ git clone https://github.com/reddit/reddit.git
next I went to r2
$ cd reddit/r2
, but when I tried to do the next 3 lines:
$ python setup.py build
$ sudo python setup.py develop
$ make
my console gave out
Traceback (most recent call last):
File "setup.py", line 35, in <module>
pkg_resources.require("distribute>=0.6.16")
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 696, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute>=0.6.16
respectively
Traceback (most recent call last):
File "setup.py", line 35, in <module>
pkg_resources.require("distribute>=0.6.16")
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 696, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute>=0.6.16
and in the end at the "make" command the console gave out:
Traceback (most recent call last):
File "Makefile.py", line 24, in <module>
from r2.lib.translation import I18N_PATH
File "/home/fox/reddit/r2/r2/lib/translation.py", line 28, in <module>
from babel.messages.extract import extract_javascript
ImportError: No module named babel.messages.extract
Makefile:41: *** Makefile.py failed. aborting. Schluss.
And now I don't have any clue what I should do. It's the first time I use a API and have zero experience with this. It would be very nice if someone of you could help me.
I had the same problem and solved it by running :
easy_install distribute
------------ Deploying frontend ------------
Preparing to deploy: Created staging directory at:
'C:\Users\ADMINI~1\AppData\Local\Temp\appcfg2555411734473986257.tmp'
java.lang.RuntimeException: The application contains Java 7 classes,
but the --use_java7 flag has not been set.
Debugging information may be found in
C:\Users\Administrator\AppData\Local\Temp\appengine-deploy7182870224187999057.log
Debug Log:
Unable to update:
java.lang.RuntimeException: The application contains Java 7 classes, but the --use_java7 flag has not been set.
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:576)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:370)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:53)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
I'm attempting to deploy a google app to my google app engine account and eclipse is giving me this error. It seems rather straight forward, but I can't find where to set a flag for java7.
I'm using the latest version of Eclipse (Juno Service Release 1) and my google plugin is 4.2.
The relevant system level property is shown here: com.google.apphosting.runtime.use_java7
It can be passed into appCfg.sh like so:
appcfg.sh --use_java7 update
As per the 1.7.3 blog post:
In an upcoming release, we will be including some of the new Java 7
functionality as well as formal Java 7 support within the App Engine
Java runtime.
and...
And while Java 7 support is not yet available within the App Engine
Java runtime, developers interested in an early preview can sign up
for our trusted tester program.
You'll need to either be accepted into the TT program, or to wait for a future release where Java 7 works in production.
I just decided to start developing apps for Android and I encountered some problems.
I get this error when I try to build a hello world example from http://developer.android.com/resources/tutorials/hello-world.html#top:
[2011-07-17 00:22:46 - Emulator] invalid command-line parameter:
Files\Android\android-sdk\tools/emulator-arm.exe. [2011-07-17 00:22:46
- Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-07-17 00:22:46 - Emulator] please use -help for more information
I have followed everything in that tutorial, how do I fix this?
There is a bug with paths. You have your SDK in C:\Program Files, but the sdk can't work with spaces in the path (this is why you only see "parameter: Files\Android\..."). Install it into a location without spaces, e.g. directly to C:\android-sdk. I think it's ok to cut & paste the complete folder into the new location and just change the path in the eclipse preferences.