Errror when packaging sencha touch for ios debug - java

I'm trying to package a sencha application for ios. But when I in the terminal do: "sencha package build package.json" I get the following
: [ERR] null
at com.sencha.command.environment.AppEnvironment.(AppEnvironment.java:48)
at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.java:193)
at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:374)
at com.sencha.command.Sencha.main(Sencha.java:127)
I probably screwed something up with the certficates and provisioning profiles, but, I'm not sure if this is some kind of environment error, ie sencha cmd not finding path of Java. The error seems to suggest this, but the cmd works with other commands. I can, for example, create a new app with "sencha app generate myapp ..myapp".
So, my question is really, is the error caused by some environment problem, and if so, what to do about it, or is his a problem related to some errror in my packager.json. Here's my packager.json file.
All help much appreciated!
{
"applicationName":"app",
"applicationId":"com.appname",
"bundleSeedId":"xxxxxxxx",
"versionString":"1.0",
"iconName":"icon.png",
"icon": {
"36":"resources/icons/Icon_Android36.png",
"48":"resources/icons/Icon_Android48.png",
"57":"resources/icons/Icon.png",
"72":"resources/icons/Icon~ipad.png",
"114":"resources/icons/Icon#2x.png",
"144":"resources/icons/Icon~ipad#2x.png"
},
"inputPath":"/Applications/XAMPP/xamppfiles/htdocs/app/",
"outputPath":"../build/",
"configuration":"Debug",
"platform":"iOS",
"deviceType":"Universal",
"certificatePath":"../cert/mycert.p12",
"certificateAlias":"iPhone Developer:",
"certificatePassword":"",
"provisionProfile":"../cert/name.mobileprovision",
"notificationConfiguration":"",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

Related

Java: Where is Autowired.Value looking for a setting?

I've inherited a large-ish Java project using org.springframework.beans.factory.annotation.Autowired, among other things.
I have one module that starts like this:
#Autowired
public Application(
FlattenByFeedRunInvoker flattenRunInvoker,
#Value("${jobId:}") String jobId,
#Value("${instanceId:}") String instanceId,
#Value("${feed}") String feed,
When I run it under debug, using this config:
{
"type": "java",
"name": "Debug (Launch)-Application<tbsm-reporting-etl-flatten>",
"request": "launch",
"mainClass": "com.tbsm.reporting.etl.flatten.Application",
"projectName": "tbsm-reporting-etl-flatten"
}
I get the message:
[ERROR] 2019-07-23 10:10:58.137 [THREAD ID=main]
[CLASS=(SpringApplication:771)] - Application startup failed
java.lang.IllegalArgumentException: Could not resolve placeholder
'feed' in value "${feed}"
I'm guessing that the framework is trying to find a value labelled "feed" somewhere. FWIW I do have a file called "default.properties" in the "resources" directory for the project and that file has the line
feed=myfeed
It looks like that file or value is not being found. I'm wondering if it is just in the wrong directory wrt the program i'm running:
..\src\main\java\com\tbsm\reporting\etl\flatten\Application.java
vs
..src\main\resources\default.properties
Or if I need to do something else to tell it where to look. e.g. does the vscode launch config need something else?

Jenkins Java: Get user who started the build

Under http://[JENKINS_NAME]/job/[JOB_NAME]/[BUILD_NUMBER]/
I can see Started by user [USER_NAME].
I want to get that username from my java application.
Any help is much appreciated.
You can make a http call to get all these details. URL to get those details is:
http://<Jenkins URL>/job/<job name>/<build number>/api/json
After the rest call, you will be getting this json.
{
"_class": "hudson.model.FreeStyleBuild",
"actions": [
{
"_class": "hudson.model.CauseAction",
"causes": [
{
"_class": "hudson.model.Cause$UserIdCause",
"shortDescription": "Started by user XXXXXX",
"userId": "xxx#yyy.com",
"userName": "ZZZZZZZZ"
}
]
},
{},
{
"_class": "jenkins.metrics.impl.TimeInQueueAction"
},
{},
{}
],
...
}
So All you have do is parse this json and get the value under javavar['actions'][0]['causes'][0]['userName']. Definitely it will be like that only. I maynot be sure about the indexes. You just try and figure out. Hope this helps.
Mostly for every page in the jenkins instance, you will be having REST API link. Please click on it to see the rest api url and its output for that url.
You could get the build user from Jenkins environment (i.e as an env var). If you use Jenkins 2 pipeline, For example:
pipeline {
//rest of the pipeline
stages {
stage('Build Info') {
steps {
wrap([$class: 'BuildUser']) {
sh 'java -jar <your_java_app>.jar'
}
}
}
}
In your java app you should be able to get the environment variable using System.getenv("BUILD_USER") or else you could pass it as a JVM arg. Ex: sh 'java -jar -DbuildUser=$BUILD_USER <your_java_app>.jar' and get the buildUser system property in the application.
On older version of Jenkins, you may use Build User Vars Plugin or Env Inject plugin. As in the answers on this question. how to get the BUILD_USER in Jenkins when job triggered by timer

[LibGDX][GWT] Error reading file skin.json in HTML [SerializationException]

i'm having some problems deploying a libGDX project to HTML. I have a skin.json file to load basic GUI and Fonts. It work perfect on Android and Desktop but in HTML it doesn't. Here is the stacktrace:
Uncaught Error: java.lang.RuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.SerializationException: Error reading file: data/skins/logo_and_font/logo_and_font.json
at f_b.V$b [as jQ] (html-0.js:7370)
at f_b.Y$b [as lQ] (html-0.js:7370)
at f_b.b_b (html-0.js:5252)
at f_b (html-0.js:1161)
at Be (html-0.js:6955)
at Ge (html-0.js:6136)
at di (html-0.js:6583)
at wh.xh [as Oc] (html-0.js:7361)
at HTMLImageElement.eval (html-0.js:5881)
Here is my .json file that im trying to load:
{
"com.badlogic.gdx.graphics.Color":{
"green":{"a":1, "b":0, "g":1, "r":0},
"white":{"a":1, "b":1, "g":1, "r":1},
"red":{"a":1, "b":0, "g":0, "r":1 },
"black":{"a":1, "b":0, "g":0, "r":0}
},
"com.badlogic.gdx.graphics.g2d.BitmapFont":{
"default-font":{
"file":"basic_font.fnt"
}
},
"com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle":{
"default":{
"font":"default-font",
"fontColor":"white"
}
}
}
If i remove the BitmatFont and LabelStyle block code it will load without any errors
"com.badlogic.gdx.graphics.g2d.BitmapFont":{
"default-font":{
"file":"basic_font.fnt"
}
},
"com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle":{
"default":{
"font":"default-font",
"fontColor":"white"
}
}
I have test it in Opera, Google Chrome, Firefox, and Internet Explorer. And the same error. So its not browser related. The game is being serve in a NodeJs server with express, but i also try it with Apache (XAMPP) and same problem, so don't think is server related. I have try with html:superDev and same problem too. I have remove the quotes from the json file and the same problem.
I load the .json file with asset manager here is the code of how i load it. I load it this way, cause im just loading the basic stuff needed to create a loading screen to then load others assets.
this.manager = new AssetManager();
this.assets = new ObjectMap<String, String>();
this.assets.put("logo_and_font_skin", "data/skins/logo_and_font/logo_and_font.json");
this.manager.load(this.assets.get("logo_and_font_skin"), Skin.class);
this.manager.finishLoading();
If i load it directly with Gdx.files.internal("data/skins/logo_and_font/logo_and_font.json"); I get the same error.
In my *.gwt.xml files i have specified the class that are going to be reflected arcording to libGDX Wiki
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.graphics.g2d.BitmapFont"/>
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.scenes.scene2d.ui.Label" />
The URI of the *.gwt.xml is the default one, but i have change to others and still get the same error. (Can't post the links cause i don't have enough reputation)
I compile the project with gradlew.bat html:dist it generated some files in /build/dist and those file are the one the i use to serve the game.
I think thats all i have try, maybe a few more thing but don't remember now. I have like 2 days in this or 3 day. It's my fisrt time deploying to a HTML with libGDX. Here is my environment:
IDE: Android Studio 2.2.3
libGDX Version: 1.9.5
Gradle Version: 2.2.3
GWT Version: 2.8.0
JDK: 1.8.0
English is not my main language so if there some typos, sorry about it.
Put your BitmapFont in your AssetManager that is referenced in your .json file.
Use finishLoading on the asset manager.
Get your BitmapFont from AssetManager.
BitmapFont x= manager.get(".....", BitmapFont.class);
Put that font into ObjectMap
ObjectMap<String, Object> font_map = new ObjectMap<String, Object>();
font_map.put("nameOfFont", x);
Use SkinLoader and pass your dependency as parameter.
manager.load(skinPath, Skin.class, new SkinLoader.SkinParameter(skinAtlas, font_map));
#AbhishekAryan yes i try that and fail too. Thanks for the response anyway.
I keep testing with diferents way of loading the BitmapFont and always fail with an error. And i started thinking that maybe it was an error with libGDX, indeed it was, i updated libGDX to 1.9.6-SNAPSHOT and the problem was solve. I loaded the BitmapFont from my uiskin.json perfectly.

starts from jnlp but not from dtjava

My app starts just fine if I download the .jnlp-file and double-click it or load it with javaws from url-to-file.jnlp. But I can not get it to start properly with the dtjava-script.
The following happens:
List item
Java starts (Java 7 - version 25)
The security-dialog shows correctly (the code is signed).
Then nothing! The process simply exits. No error-messages. No nothing.
I am developing on a Mac. But the same happens on Windows-machines.
Any thoughts?
Problem solved!
The suggestion to try a tiny "hello world" first led me to the idea to try to set the initial-heap-size in the jnlp-file. This caused the program not to exit on error and I saw that there was an exception related to some reloader code ... which lead me to think that something was causing a failed attempt to load a preloader.
Here is what my code was:
dtjava.launch(
{
url : jnlp_path,
params: {
'key5': 'value 5',
'key6': 'value 6!' } },
{
javafx : '2.2+',
toolkit: 'swing' },
{} );
The solution was to simply remove javafx : '2.2+',
I guess the javafx-param was causing an attempt to first load a non-existent JavaFX preloader.

Problems using Matlab Builder JA

First of all I would like to thank in advance everyone for reading such a long post. I really appreciate your help.
The thing is that I've been doing some research on how to "connect" Matlab and Java for a project I am working on for university. I figured that the most suitable option was using Matlab Builder JA, but I'm having a lot of troubles with it.
I follow step by step the instructions described on a tutorial (the link of the video in below) but get compilation errors over and over, and I really don't know how to fix them. The tutorial is about creating a Java package (demo.jar) with MATLAB ("com.demo"), which contains a class (MLTestClass) with a function makeSqr(n) which returns an n × n square matrix. Then I go to Eclipse, I add to the project both libraries javabuilder.jar and demo.jar and then create the following class:
public class Driver {
public static void main (String[] args) {
MLTestClass x = null;
Object result [] = null;
try {
x = new MLTestClass ();
result = x.makeSqr (1, 5);
System.out.println (result [0]);
} catch (MWException e) {
e.printStackTrace();
}
}
}
Of course I import com.demo.* and com.mathworks.toolbox.javabuilder.*.
Here are the errors the console gives me:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getProxyLibraryDir(MCRConfiguration.java:163)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.get(MCRConfiguration.java:77)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.<clinit>(MCRConfiguration.java:87)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot(MCRConfiguration.java:92)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ModuleDir.<clinit>(MCRConfiguration.java:66)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getModuleDir(MCRConfiguration.java:71)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1573)
at com.demo.DemoMCRFactory.(DemoMCRFactory.java:122)
at com.demo.MLTestClass.(MLTestClass.java:63)
at Driver.main(Driver.java:12)
Caused by: java.lang.NullPointerException
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.get(MCRConfiguration.java:143)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.<clinit>(MCRConfiguration.java:158)
... 10 more
Just in case, link tutorial (it's the video): http://www.mathworks.nl/products/javabuilder/description2.html
Anyone has any ideas what the problem could be? It says something about NullPointerException, but I don't know how to solve it as the constructor is provided by the class created with MATLAB. I didn't have any issues installing MCR, and by the way I have MacOS, which I hope is not the source of the problem :).
Again, sorry for the long post and thank you for your time.
Béntor.
Yes, please install MCR. The installation also mentions about setting environmental variables like LD_LIBRARY_PATH etc. If you are using eclipse, i would recommend you update the environmental variables
right click->
properties ->
run/debug settings->
environmental variables
I also had to make sure that variable MCR_CACHE_ROOT pointed to different directory since my home directory was not big enough.
You have install MCR (avaliable in http://www.mathworks.com/products/compiler/mcr/index.html)
None of the above solutions helped me (I already had MCR installed and Macs use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH), and noone else online seemed to know. Finally in desperation, I tried editing the DYLD_LIBRARY_PATH and finally got it to work by removing the last part of it: /Applications/MATLAB/MATLAB_Compiler_Runtime/v82/sys/java/jre/maci64/jre/lib
Now the demo application from the tutorial works.
Next comes trying to make my code work.
OS X Paths for Run-Time Deployment
Use these setenv commands to set your MATLAB Runtime paths.
setenv DYLD_LIBRARY_PATH \
mcr_root/version/runtime/maci64 \
mcr_root/version/bin/maci64 \
mcr_root/version/sys/os/maci64
Source: http://www.mathworks.com/help/compiler_sdk/java/mcr-path-settings-for-run-time-deployment.html

Categories