Buildozer, How to add external python packages? - java

I have built a kivy app using Python 2.7. I have used the import statements
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.widget import Widget
from kivy.properties import *
from kivy.uix.textinput import TextInput
from kivy.uix.image import Image
from kivy.uix.image import AsyncImage
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy import Config
import sqlite3
import webbrowser
from kivy.lang import Builder
import re
from bs4 import BeautifulSoup
import unicodedata
from threading import Thread
import requests`
In my Buildozer.spec file
requirements = kivy,requests,bs4
I have set the requirements to use these, as the rest of the packages are inbuilt in Python. I did not specify them. The APK Gets built and I run it on my android phone and the app crashes without any error. I dont understand where the problem lies. If it is my buildozer spec requirements or improper usage of packages.
I have been searching all over the internet , and I have read the Buildozer docs, But I haven't been able to find a good tutorial on how to use Buildozer . I am using it on Linux. Can someone explain what is going wrong?

I have been having the same problem. I've narrowed it down to the bs4 library, at the moment i havent got to the bottom of it but i think it is something to do with mixing python 2.7 ans python 3. Anyway the first link is to my (so far) unsolved question.
Kivy App build with Buildozer. APK crash
The following link is to a set of instructions that may help you find your problem.
adb install instructions:-
http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378
adb logcat fault finding:-
adb logcat hangs with "waiting for device" message
Hope this helps.

Related

getting a import cannot be resolved error for import org.apache.http.client.methods.HttpGet

Im using eclipse Photon. The code worcked fine on old computer. When I got a new computer and tried to run the program The following imports are give me a import cannot be resolved error
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
I'm assuming im missing some jar files. Could some one tell me what jar files I need and whare i can find them? Also why does it work find on ole computer with same jars being added?
Those two classes are part of Apache HTTP Components which you can access from https://hc.apache.org/index.html.

UnsatisfiedLinkError while executing new Mat()

i am currently trying to code a little program to take picture of newly students and save them by their names etc to ease the inscriptions things etc.
So here is my problem, i found a great tutorial to help me using a webcam:
http://www.codeproject.com/Tips/717283/How-to-use-OpenCV-with-Java-under-NetBeans-IDE
I can run this project with no error but when i try to import some code to mine i got this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat()J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.<init>(Mat.java:24)
at recupphoto.Ihm.<init>(Ihm.java:38)
at recupphoto.RecupPhoto.main(RecupPhoto.java:19)
Java Result: 1
The error occurs when i execute theses lines:
Mat frame = new Mat();
MatOfByte mem = new MatOfByte();
Here are my imports in case it could help to find out:
import java.util.ArrayList;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import org.opencv.core.Mat;
import org.opencv.core.MatOfByte;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.videoio.VideoCapture;
While compilation i got this message, dunno if related or so
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Both error appears (i guess) when Mat() is called but i cannot find how to fix this.
I should really use some helps or tips here! Thanks for reading this and sorry for my bad english!
Finaly solved my problem, the fact was that i called
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
too late, so i moved it a bit and solved that :) Thanks for all who spend a bit of their time to help me there!
Step 1 Get dependency walker application.
Step 2 Browse into the relevant library folder.
Step 3 See what's missing and get it.
Tips:
Make sure You get DLL's for your architecture either 32bit or 64bit.
Make sure to compile with proper java (32bit/64bit) depending on which DLL's you provide.
Lastly if the dependencies you are missing start with MSVCP***.dll download Microsoft Visual C++ Packages. Again care for the architecture. I recommend you start with this step.

Where do I find Javx.comm or RxTx and how do I get them into Eclipse?

I am trying to add COM port access to an application I have in Eclipse.
import javax.comm.*;
says the import cannot be resolved. When I search for javax.comm I am also directed to RxTX. Which do I want and how do I get them into the IDE so that the import will work?

Java Class PPM, PPMImage not found, where to get JAR Files

I need help and wanted to ask if somebody knows where to get the JAR Files for my system library (eclipse helios), cause I need to use those classes PPM and PPMImage but the import declarations seem not to work
package com.sun.media.imageio.plugins.pnm;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.*;
import java.lang.*;
import com.apple.*;
import de.medieninf.ads.*;
this is what I have implemented so far
I googled this hard but couldnt find anything.
You need to install Java Advanced Image and its plugin Java Advanced Image I/O Tools: JAI 1.1.3 and JAI I/O Tools 1.1
These provide you the PNM plugins are trying to use.

Java missing libraries

I'm using Eclipse on Mac OS X 10.6.6.
For some reason when I'm trying to import the following libraries I get this error:-
java.apt (only java.apt.font is available)
javax.swing
The system is fully updated with the recent updates
Thanks in advance
Are you doing
import javax.swing;
or are you doing
import javax.swing.*;
The difference is very important.
As a general rule, I try to import only the exact classes I need.

Categories