Can someone help me with this error, I can't seem to identify the problem. I am also new in using Scons. I need to get through this to obtain the .aar and .apk files. I am using Iotivity for a project that allows users to share transfer images between devices of any platform without internet.
Command Prompt:
C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1>scons TARGET_OS=android
scons: Reading SConscript files ...
Processing using SCons version 3.1.1
Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 21:01:17) [MSC v.1500 64 bit (AMD64)] on win32
NameError: name 'host_arch' is not defined:
File "C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1\SConstruct", line 32:
SConscript('build_common/SConscript')
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 668:
return method(*args, **kw)
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 605:
return _SConscript(self.fs, *files, **subst_kw)
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1\build_common\SConscript", line 1025:
env.SConscript(target_os + '/SConscript')
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 605:
return _SConscript(self.fs, *files, **subst_kw)
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1\build_common\android\SConscript", line 19:
SConscript('#/extlibs/android/ndk/SConscript')
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 668:
return method(*args, **kw)
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 605:
return _SConscript(self.fs, *files, **subst_kw)
File "c:\python27\lib\site-packages\scons\SCons\Script\SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1\extlibs\android\ndk\SConscript", line 24:
if host_arch in ['x86_64']:
It's broken. I guess I'm the one who broke it when I tried to clean up that part of the build some years ago. The iotivity project CI system does not build android binaries on a windows host, it uses a linux builder for that, and I guess no developer did either so nothing detected the problem, which as the error message says, is that host_arch is undefined. This is not fundamental to iotivity, it's just dependency work to set up the Android NDK; once you have one set up this stuff is skipped for subsequent builds. The previous version switched on target_arch which wasn't right - the bundle to get depends on the host, not on what you're building for. I think the Android project stopped supporting 32-bit bundles a while back anyway so the simplest way to move forward is to remove the test (unless for some reason you have 32-bit Windows). That is, change this chunk starting with line 23:
else:
if host_arch in ['x86_64']:
ndk_url = ndk_url_base + '-windows-x86_64.exe'
else:
ndk_url = ndk_url_base + '-windows-x86.exe'
ndk_bundle = 'android-ndk-' + NDK_VER + '.exe'
to the simpler form:
else:
ndk_url = ndk_url_base + '-windows-x86_64.exe'
ndk_bundle = 'android-ndk-' + NDK_VER + '.exe'
(if it wasn't clear, that meant edit the file in the last line of the traceback, C:\Users\derrick\Desktop\iotivity-2.0.1.1\iotivity-2.0.1.1\extlibs\android\ndk\SConscript)
Related
My code:
import tabula
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
file_path = dir_path + '\ALPINE_' + str(20191107) + '.pdf'
print(file_path)
df = tabula.read_pdf('ALPINE_20191107.pdf',multiple_tables=True, pages="all")
result:
runfile('C:/Users/Admin/Documents/lucas/testTabula.py.py', wdir='C:/Users/Admin/Documents/lucas')
Traceback (most recent call last):
File "<ipython-input-29-a6b390aef3cf>", line 1, in <module>
runfile('C:/Users/Admin/Documents/lucas/sem título0.py', wdir='C:/Users/Admin/Documents/lucas')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Admin/Documents/lucas/sem título0.py", line 12, in <module>
df = tabula.read_pdf('ALPINE_20191107.pdf',multiple_tables=True, pages="all")
File "C:\ProgramData\Anaconda3\lib\site-packages\tabula\io.py", line 332, in read_pdf
return _extract_from(raw_json, pandas_options)
File "C:\ProgramData\Anaconda3\lib\site-packages\tabula\io.py", line 664, in _extract_from
df[c] = pd.to_numeric(df[c], errors="ignore")
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\tools\numeric.py", line 138, in to_numeric
raise TypeError("arg must be a list, tuple, 1-d array, or Series")
TypeError: arg must be a list, tuple, 1-d array, or Series
It's function doesn't seem to work. I could directly type the path to make even simpler, but it didn't work either. It could be a problem with the pdf file, but I already saw it working in another environment with the same script and the same file.
I already have java set on both possible PATHs ('C:\Program Files\Java\jre1.8.0_231\bin') as by documentation but it really doesn't matter, the error occurs with or without then set on PATH. I've tried adding jdk as well but didn't solve either.
I notice the error mentioning pandas so maybe it's conflicting with my version (the latest), but i'm not sure.
python is 3.7.4 and java is the latest to this date
I have had the same issue. I was using the version installed using pip, i.e. tabula-py 2.0.0. I uninstalled the version, and installed from Anaconda using conda install -c conda-forge tabula-py, and current version is tabula-py 1.4.1, which resolved this issue.
I want to include Java source code from multiple directories (which are shared between projects) in a Qt for Android project. On http://imaginativethinking.ca/what-the-heck-how-do-i-share-java-code-between-qt-android-projects/ an approach is described which copies the Java source files:
# This line makes sure my custom manifest file and project specific java code is copied to the android-build folder
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
# This is a custom variable which holds the path to my common Java code
# I use the $$system_path() qMake function to make sure that my directory separators are correct for the platform I'm compiling on as you need to use the correct separator in the Make file (i.e. \ for Windows and / for Linux)
commonAndroidFilesPath = $$system_path( $$PWD/../CommonLib/android-sources/src )
# This is a custom variable which holds the path to the src folder in the output directory. That is where they need to go for the ANT script to compile them.
androidBuildOutputDir = $$system_path( $$OUT_PWD/../android-build/src )
# Here is the magic, this is the actual copy command I want to run.
# Make has a platform agnostic copy command macro you can use which substitutes the correct copy command for the platform you are on: $(COPY_DIR)
copyCommonJavaFiles.commands = $(COPY_DIR) $${commonAndroidFilesPath} $${androidBuildOutputDir}
# I tack it on to the 'first' target which exists by default just because I know this will happen before the ANT script gets run.
first.depends = $(first) copyCommonJavaFiles
export(first.depends)
export(copyCommonJavaFiles.commands)
QMAKE_EXTRA_TARGETS += first copyCommonJavaFiles
With later Qt versions the code has to be changed to this:
commonAndroidFilesPath = $$system_path($$PWD/android/src)
androidBuildOutputDir = $$system_path($$OUT_PWD/../android-build)
createCommonJavaFilesDir.commands = $(MKDIR) $${androidBuildOutputDir}
copyCommonJavaFiles.commands = $(COPY_DIR) $${commonAndroidFilesPath} $${androidBuildOutputDir}
first.depends = $(first) createCommonJavaFilesDir copyCommonJavaFiles
export(first.depends)
export(createCommonJavaFilesDir.commands)
export(copyCommonJavaFiles.commands)
QMAKE_EXTRA_TARGETS += first createCommonJavaFilesDir copyCommonJavaFiles
Is this the standard way to go, or is there some built-in functionality for including multiple Java source directories in Qt for Android projects?
Regards,
A much cleaner solution is this one:
CONFIG += file_copies
COPIES += commonJavaFilesCopy
commonJavaFilesCopy.files = $$files($$system_path($$PWD/android/src))
commonJavaFilesCopy.path = $$OUT_PWD/android-build
I'm running the following Ansible task to change permission of a directory and its content.
- name: Change ownership of everything below /opt/as2/app-server
file: path=/opt/as2/app-server state=directory recurse=yes owner=adrt group=adrt
When running it I get the following issue:
TASK [appserver : Change ownership of everything below /opt/as2/app-server] ****
fatal: [192.168.1.182]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 451, in \r\n main()\r\n File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 335, in main\r\n changed |= recursive_set_attributes(module, to_bytes(file_args['path'], errors='surrogate_or_strict'), follow, file_args)\r\n File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 146, in recursive_set_attributes\r\n changed |= module.set_fs_attributes_if_different(tmp_file_args, changed)\r\n File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 1163, in set_fs_attributes_if_different\r\n File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 929, in set_owner_if_different\r\n File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 842, in user_and_group\r\nOSError: [Errno 2] No such file or directory: '/opt/as2/app-server-1.0.0/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/As2MetricsService/usr/bin/python$tt__collectStats_closure14.class'\r\n", "msg": "MODULE FAILURE"}
Basically it says there is no such file or directory as,
/opt/as2/app-server-1.0.0/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/As2MetricsService/usr/bin/python$tt__collectStats_closure14.class
The content of the directory, /opt/as2/app-server/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/ is,
As2MetricsService$_$tt__CountStatisticsLists_closure3.class
As2MetricsService$_$tt__collectStats_closure10.class
As2MetricsService$_$tt__collectStats_closure11.class
As2MetricsService$_$tt__collectStats_closure12.class
As2MetricsService$_$tt__collectStats_closure13.class
As2MetricsService$_$tt__collectStats_closure14.class
As2MetricsService$_$tt__collectStats_closure15.class
As2MetricsService$_$tt__collectStats_closure4.class
As2MetricsService$_$tt__collectStats_closure5.class
As2MetricsService$_$tt__collectStats_closure6.class
As2MetricsService$_$tt__collectStats_closure7.class
As2MetricsService$_$tt__collectStats_closure8.class
As2MetricsService$_$tt__collectStats_closure9.class
As2MetricsService$_CountStatisticsLists_closure1.class
As2MetricsService$_collectStats_closure2.class
As2MetricsService.class
There are no subdirectories.
Also when I run the command chown -R adrt:adrt . inside the directory /opt/as2/app-server it executes without any issue.
Help me to understand what is happening here.
Help me to understand what is happening here.
You have just found a bug in Ansible which causes modules to fail when the names of files it processes contain $_ sequence.
The name is passed without escaping the $ character (or rather with an explicit conversion request os.path.expandvars(filename)) and the sequence $_ is processed as an built-in variable resolving to the path of the current process (/usr/bin/python in this case, as Ansible uses Python to run its modules).
In result the file name:
As2MetricsService$_$tt__collectStats_closure14.class
is interpreted as:
As2MetricsService/usr/bin/python$tt__collectStats_closure14.class
and the system throws an error that the file does not exist (which is true).
Until it is fixed, I guess you have to call chown with the command module
I am working on a application which first require to check the available free disk space before running any operation. We have set some Default required Space limit like 512MB, So if any working drive does not have more then 512mb space my program will prompt for less memory space available, please make sufficient space to run the program.
I am using following code for it.
long freeSpace = FileSystemUtils.freeSpaceKb() * 1024;
here I am coverting size into byte first to compare with our standard required size.
Due to the above statement i am gettign following exception:
Error-Command line returned OS error code '3' for command [cmd.exe, /C, dir /-c "F:\MyApp\"]Stacktrace java.io.IOException: Command line returned OS error code '3' for command [cmd.exe, /C, dir /-c "F:\MyApp"]
at org.apache.commons.io.FileSystemUtils.performCommand(FileSystemUtils.java:506)
at org.apache.commons.io.FileSystemUtils.freeSpaceWindows(FileSystemUtils.java:303)
at org.apache.commons.io.FileSystemUtils.freeSpaceOS(FileSystemUtils.java:270)
at org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:206)
at org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:240)
at org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:222)...
The OS returned Error Code is '3' thats mean it is not normal termination.
So now how can I resolve this issue ?
I also found alternative method available in java 1.6 - How to find how much disk space is left using Java?
new File("c:\\").getFreeSpace();
---------------------------------
**More Details :**
---------------------------------
OS Architecture : amd64
Temp Dir : c:\temp\
OS Name : Windows 7
OS Version : 6.1 amd64
Jre Version : 1.6.0_45-b06
User Home : C:\Users\Tej.Kiran
User Language : en
User Country: US
File Separator : \
Current Working Directory : F:\MyApp\
You can try executing that command from a prompt. Run cmd.exe and enter the following:
cmd.exe /C dir /-c "F:\MyApp\"
echo %errorlevel%
Error code 3 means the path doesn't exist, but in this case I wonder if it is related to permissions. Any non-zero errorlevel is a problem. If your Java app needs to know the free space on the drive it is installed on, you can do something like this:
// returns something like "file:/C:/MyApp/my/pkg/MyClass.class"
// -OR- "jar:file:/C:/MyApp/myjar.jar!/my/pkg/MyClass.class"
String myPath = my.pkg.MyClass.class.getResource(MyClass.class).toString();
int start = myPath.indexOf("file:/") + 6;
FileSystemUtils.freeSpaceKb(myPath.substring(start, myPath.indexOf("/", start));
Obviously this code wouldn't work in an applet, but that shouldn't be surprising. The substring logic should also be more robust, but this is just a simple example.
I am getting a too long line error while trying to build a jar. the long line in the manifest file is the Class-Path line as the application uses a lot of third-party libraries. needless to say, I am using Windows :-( and Eclipse Java 1.6
I tried Class-Path: lib or Class-Path: lib/ but they did not work.
The classpath is too long due to the number of jar files in it. «No line may be longer than 72 bytes (not characters), in its UTF8-encoded form.» [from docs: java 5, java 8; «Line length» section].
use as the following way to resolve the problem:
(1) use separate lines, to avoid too long a line for java package name lists
(2) type a preceding space before each folloing lines, for example:
Class-Path:
...jar
...jar
...jar
The single character didn't work for me (Java 8, IntelliJ). I used two characters at the start and no characters at the end of the line (wasn't apparent from the above example) and two new lines at the end, e.g.
Manifest-Version: 1.0
Main-Class: com.mypackage.MyApp
Implementation-Version: 2.0.0
Class-Path: newLibs/asjava.zip
newLibs/activation.jar
newLibs/axis-ant.jar
newLibs/axis.jar
newLibs/bcel-5.1.jar
newLibs/commons-discovery-0.2.jar
newLibs/commons-logging-1.0.4.jar
newLibs/datanucleus-api-jdo-4.2.0-release.jar
newLibs/datanucleus-api-jpa-4.1.4.jar
newLibs/datanucleus-cache-4.0.4.jar
newLibs/datanucleus-core-4.1.5.jar
newLibs/datanucleus-geospatial-4.1.0-release.jar
newLibs/datanucleus-guava-4.1.3.jar
newLibs/datanucleus-java8-4.2.0-release.jar
newLibs/datanucleus-jdo-query-4.2.0-release.jar
newLibs/datanucleus-jodatime-4.1.1.jar
newLibs/datanucleus-jpa-query-4.0.4.jar
newLibs/datanucleus-rdbms-4.1.6.jar
newLibs/dom4j-1.6.1.jar
newLibs/ehcache-1.1.jar
newLibs/ehcache-core-2.2.0.jar
newLibs/geronimo-jta_1.1_spec-1.1.jar
newLibs/guava-15.0.jar
newLibs/h2-1.3.168.jar
newLibs/ibmjsse.jar
newLibs/javax.jdo-3.2.0-m3.jar
newLibs/javax.persistence-2.1.1.jar
newLibs/jaxrpc.jar
newLibs/jdo-api-3.1-rc1.jar
newLibs/jdom.jar
newLibs/joda-time-1.6.jar
newLibs/jtds-1.2.jar
newLibs/log4j-1.2.14.jar
newLibs/mail.jar
newLibs/saaj.jar
newLibs/servlet-api.jar
newLibs/wsdl4j-1.5.1.jar
newLibs/xercesImpl.jar
newLibs/xml-apis.jar
I also avoided placing multiple jars on one line as that didn't appear to work (even with lines less than 72 bytes).
What led me to arrive at this solution was (1) I kept getting various class not found exceptions, of course and (2) When I examined the generated manifest file in the jar file, the spacing between the jars was missing - I assume that it was silently failing because there was no reported error apart from the class not found exceptions. My working, generated manifest file looks like this:
Manifest-Version: 1.0
Implementation-Version: 2.0.0
Class-Path: newLibs/asjava.zip newLibs/activation.jar newLibs/axis-an
t.jar newLibs/axis.jar newLibs/bcel-5.1.jar newLibs/commons-discovery
-0.2.jar newLibs/commons-logging-1.0.4.jar newLibs/datanucleus-api-jd
o-4.2.0-release.jar newLibs/datanucleus-api-jpa-4.1.4.jar newLibs/dat
anucleus-cache-4.0.4.jar newLibs/datanucleus-core-4.1.5.jar newLibs/d
atanucleus-geospatial-4.1.0-release.jar newLibs/datanucleus-guava-4.1
.3.jar newLibs/datanucleus-java8-4.2.0-release.jar newLibs/datanucleu
s-jdo-query-4.2.0-release.jar newLibs/datanucleus-jodatime-4.1.1.jar
newLibs/datanucleus-jpa-query-4.0.4.jar newLibs/datanucleus-rdbms-4.1
.6.jar newLibs/dom4j-1.6.1.jar newLibs/ehcache-1.1.jar newLibs/ehcach
e-core-2.2.0.jar newLibs/geronimo-jta_1.1_spec-1.1.jar newLibs/guava-
15.0.jar newLibs/h2-1.3.168.jar newLibs/ibmjsse.jar newLibs/javax.jdo
-3.2.0-m3.jar newLibs/javax.persistence-2.1.1.jar newLibs/jaxrpc.jar
newLibs/jdo-api-3.1-rc1.jar newLibs/jdom.jar newLibs/joda-time-1.6.ja
r newLibs/jtds-1.2.jar newLibs/junit-3.8.1.jar newLibs/log4j-1.2.14.j
ar newLibs/mail.jar newLibs/saaj.jar newLibs/servlet-api.jar newLibs/
wsdl4j-1.5.1.jar newLibs/xercesImpl.jar newLibs/xml-apis.jar
Main-Class: com.mypackage.MyApp
The answer of Voodoochild put me on the right track but wasn't so clear to me so quoting the specs:
No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).
Manifest example:
Manifest-Version: 1.0
Main-Class: com.mypackage.MyApp
Class-path: commons-beanutils-1.7.0.jar commons-collections-3.1.jar
commons-dbcp-1.2.2.jar commons-discovery.jar commons-lang-2.1.jar
commons-pool-1.2.jar ezjcom18.jar jbcl.jar log4j-1.2.14.jar
sqljdbc.jar torque-3.2-rc2.jar
The multi-space solutions up there didn't work for me for some reason. So I looked at how Eclipse's export-runnable-jar dialog does it. It adds an Ascii "LF" and then a space as a linebreak.
In Java: char LF = (char) 0x0A;
For too long line error
Use Class-Path: *.*