Why can't I build my app on the build server after adding the "CodeScanner Library" extension? - codenameone

I am using Netbeans 12 with Maven
Image 1.
a. Create the "Test" application.
b. I clean and build (just to ensure it works - it shows me temporary signature message).
c. I install the extension
d. I solve problems of the project on the common folder.
Image #2.
I clean and build the project.
Image #3
Note that the "BUILD SUCCES" message appears in the console, but the window asking me if I authorize the use of a temporary signature does not appear.
Note: The app runs perfectly in the simulator.

Related

How do i efficiently send my react built app to other person

i have built a single page web application using react as part of an assignment.
i have created build version of it using serve -s build.
now my entire application takes around 200MB.
how do i share my application to the person who gave me this assignment so that he can check my work and output?
do i have to send him entire application folder(200MB size)?
or is there a way to send few files which will be enough for him to run the app.
please let me know possible ways of sharing my react application with him.
i figured out that only build folder(20MB) is enough run my app.
i copied build folder into another new folder("deploy-app").
now i opened "deploy-app" folder in VS code and ran following command "serve -s build" and it started working without any problems.
Is the application 200MB+ because of the dependencies/node_modules?
You can probably exclude these as they should be in your package.json file, i.e. they can be requested again if required.
Then you can send the source code and your built version to him.

How to add Scandit barcode plugin to custom build of Phonegap developer ios app?

I use Phonegap Desktop and Phonegap Developer app for a while now. This is really interesting for quickly testing my development.
But I'm facing a limitation with the embedded barcode scanner which is displaying the camera display in full screen.
I need to embed the camera display into a container so I have space for displaying information in the same time.
After searching for a while, I've discovered the Scandit SDK for PhoneGap was the only plugin which allows cropping the camera display.
I spent a lot of time trying to implement Scandit, but no success. At least I can build the app, but when using it, scanner is not working...
Here are the steps I've followed:
clone the PhoneGap Developer project from Git
Install using npm
add ios platform
open the xcode project file
build the application and run it on device
=> At this time the PG Dev is running well and my application is working fine
Then, i continued:
remove all reference to the default barcode scanner plugin
build the application and run it on device
==> PG Dev still working fine and my application is working fine
Next steps:
clone the Scandit phonegap plugin from Git
download the Scandit SDK from my scandit account
put the SDK into the cloned scandit phonegap plugin
modify the plugin.xml to change the path to the bundle and framework (mismatch of version name in the path)
<resource-file src="src/ios/scanditsdk-community-ios_4.16.1/ScanditBarcodeScanner.bundle"/>
<framework src="src/ios/scanditsdk-community-ios_4.16.1/ScanditBarcodeScanner.framework" custom="true"/>
copy bundle and framework into the correct folder of scandit
modify the config.xml to include reference to Scandit and set the spec attribut to the version of the SDK
build the application and run it on device
==> PG Dev still working fine and my application is working fine (it doesn't use scandit for the moment)
Next steps:
Remove my project from PhoneGap desktop
add Scandit Sample project to PG Desktop
I used the "Continuous Scaled/Cropped" example from there: http://docs.scandit.com/4.12/phonegap/cordova-examples.html
add my App Key for the license
launch my PG Dev app on my device and download the project files
==> PG Dev is running fine and download the Scandit Sample App.
But the app doesn't work. When clicking on the scan button, nothing happends..
After some investigation, I found that I ran through an exception on Scandit class.
Adding a try on the command 'Scandit.License.setAppKey' allowed me to report in the PG Desktop log the following error:
ReferenceError: Can't find variable: Scandit
Adding this try/catch made the app raising an exception at the next line:
var settings = new Scandit.ScanSettings();
After searching the web about my error, and some posts were suggesting to manually add the framework and bundle into xcode.
So I did it by drag&droping the framework and bundle into the framework folder of the xcode project.
But when I try building my project, it is failing with many errors...
To solve it, I had to had manually all the scandit plugin files (*.h and *.m) into my xcode project.
All previous errors have been solved, but new ones appeared.
This was due to some other missing native ios frameworks...
Once these framework added, all errors were solved and I managed to successfully build the application.
But when running it, I'm still having the error: "ReferenceError: Can't find variable: Scandit"
I'm now running out of idea..
What did I do wrong?
Is there anyone having managed to build a PG Desktop with Scandit embedded?
Thanks.
Sorry for this long post, just tried to be the more precise I could be.
The issue here is two fold. First you need to be aware that the Scandit Barcode Scanner plugin makes use of native code and can therefore not be used in the Phonegap Developer app, as the only thing transmitted to it is your html/css/javascript and the javascript part of the plugin. To also include the native parts of the plugin you have to build and deploy the project yourself. As you are trying to build the XCode project it seems like you are now doing this.
The second part is that you are way overcomplicating the adding of the plugin. There is no need for you to manually clone the git repo, add our libraries, adjust paths in the plugin.xml etc. You can directly download the entire plugin as a zip from your account at scandit.com where the library is contained and the plugin.xml is correct. After that you can simply add the plugin to your project through the CLI (also see our documentation for this at http://docs.scandit.com/stable/phonegap/cordova-integrate.html) and there is no need to do anything manually unless you are using a very outdated Phonegap version that fails to properly handle the plugin.xml. Doing it the automated way with our properly prepared plugin zip will remove most error sources, please try it that way.
Thanks #moritzha. It helped me finding the solution.
I followed this doc at the beginning but it was not working.
After adding the plugin and building the application, I never managed to see it in my xcode project.
I took the opportunity of changing my mac to restart everything from scratch, and after many tries I found where I was wrong.
In fact, the documentation provided by scandit is missing one step.
The command ' phonegap plugin add < path to downloaded and unzipped plugin > ' is doing half of the job.
The command is correctly copying the plugin files to my project but it is not updating the config.xml.
So before building your application, you have to edit the config.xml located at the root of your project folder.
You need to manually reference the plugin with the following:
and replace the x by the version of the sdk you will use.
Once the config.xml updated, you will be able to build the app for your targeted platform.
I now have my own version of the Phonegap Developer App with the Scandit plugin in place of the default barcode scanner plugin. And it works perfectly.
This plugin is awesome!
PhoneGap Developer App version: 1.7.2 (taken on Github)

Managing Demo / Full version of my app in Codename One

I was ordered to deliver an app in 2 versions : one demo/light (limitted features) the other full (all features). I have a boolean in code which tells which one is running. They both run as expected in the simulator or on a test device (iOS and Android).
Now I want to distribute them. So I read that it was possible with XCode to define different targets corresponding to the light / full versions and with Eclipse it was possible to define the base project as a library and then create 2 projects also corresponding to the light / full versions.
Before I start messing around with my app project, is there a recommended way to achieve my goal with CodenameOne maybe via build hints that would change the app name and the boolean inside the code depending on a build hint value ?
EDIT 19/09/2016 (working methodology)
Following Shai's advices here are the steps I followed to generate a light version based on the full one (in case someone encounters the same case) :
Under your IDE (Eclipse or whathever) copy and paste the base package in the src folder and rename it com.packageLIGHT.appName (simply append LIGHT to the package name, don't use underscore or space since it will be considered as an illegal character later by Apple)
=> So now in src folder you should have
src
|- com.packageLIGHT.appName
|- com.package.appName
Then in com.packageLIGHT.appName remove all files except MyApp.java (aka the main file). In this file add import com.package.myApp.*;
3.1. (ECLIPSE) In "Run/Run Configurations" menu copy the existing config and paste it as Simulator_MyAppLIGHT and in arguments change it to "com.packageLIGHT.myApp.MyApp".
3.2. (NETBEANS) The "Run/Set Project Configuration" does not seem to work as expected since any configuration that might be selected leads to the same default behaviour. However applying step 6. and running the project in the simulator afterward has the expected result.
Now you should be able to run both versions by running the different configurations.
For iOS (not sure if it is also needed for Android) you have to generate another pair of provisioning files. So move the existing ones in iosCerts/FULL and use CN1 wizard to generate the "light" version provisioning files where you'll adapt the package name to match "com.packageLIGHT.myApp". Store the generated files in iosCerts/LIGHT. There is no need to overwrite the existing certificates (more on certificate here).
Finally replace in "codenameone_settings.properties" the original package name with the "light" one for the lines codename1.ios.appid and codename1.packageName. Also change the iOS provisioning files to iosCerts/LIGHT or FULL depending of what you want to build.
Now when you send the Android / iOS build to CN1 server it will build either the "light" version or the full one depending on what package is written in "codenameone_settings.properties".
Please note : if at step 6. you get NullPointerException on build.xml on line 469 (android build) or 344 (iOS build) which deals with certPassword="${codename1.android.keystorePassword} (android build) or appid="${codename1.ios.appid}" (iOS build) and you're using CN1 plugin version 1.0.0 20160812 under Eclipse then Shai's comment below may be worth it
If you want 2 distinct versions of the same app then you need 2 distinct packages since the thing that defines the app uniquely in the store is the app package. There are two common ways to do it:
Place functionality in cn1lib and build two apps
Build one app and just swap the codenameone_settings.properties file
The first one should be pretty clear but might be a bit painful to work with as you can't run the cn1lib and might run into issues debugging it.
The second one is actually rather simple. Create the main version of the app then add the package to the demo version and copy the main file there.
To run the demo version just change the package in the IDE "run settings".
Copy your codenameone_settings.properties to a separate file and just replace all the regular package names to the demo package names. When you want to build the "demo" version replace the codenameone_settings.propeties files with one another, you can automate that with a script obviously.

'A program file was not specified in the launch configuration' on Eclipse Luna CDT (C Project)

So I am new to CDT (even though I have worked with C and Eclipse Java before), and seem to be getting the error as shown in the picture below:
Now, when I check the Run Configurations, the application field of the debug applicaiton seems to be empty, as shown below:
Finally, when I check the actual physical location of where the debug executable should be, the folder seems to be empty, even though I am going through the build process.
Does anyone know why this problem is being caused, and why exactly eclipse isn't building/compiling my executable?
NOTE : I am currently using Eclipse Luna.
It seems that your program doesn't compile correctly, maybe because you have a build error at the compiler level...
Try to press CTRL+B and see if in the problems section you get some errors of the compiler .
If you are familiar with developing Java in Eclipse, then you might have hit a problem that the default setting for Java is to continuously build. However for CDT you need to tell Eclipse to build the project. This can be done by pressing CTRL+B to build all projects in the workspace, or right-clicking on the desired project and selecting Build Project.
Once you have the first build of your project, future builds can be completed automatically by using the Build (if required) before launching option in Window | Preferences | Run/Debug | Launching as shown in this screenshot:
Once you do the first build and set up your launch configuration. Then the edit/debug cycle becomes very efficient, simply code and hit Run or Debug button when ready.

Google App Engine - recompile GWT module

I've created Google App Engine project in Java using Eclipse following the book Beginning Java Google App Engine
Before I bought this book I had created projects with unchecked option 'Use Google Web Toolkit' but for this project I checked it (following the book)
Eclipse generated several files for me and I run my applications, copy link to Web Browser (http://localhost:8888) and it gives me an error:
GWT module name_of_my_project may need to be (re)complied
I work on Ubuntu 10.04 (I was testing my application using Firefox and Chromium) and I was trying run my application on Windows XP (using the same Web Browsers) with the same effect (just one difference - Google Chrome made me install Web Toolkit...so I did it but it still gives the same error)
Thanks in advance :)
I get the same error message at unexpected times using development on IntelliJ with Chrome. The message still appears when I stop and start development mode. The problem is fixed after I delete the compiled files (class files, js files) in the out folder. On eclipse, you can try deleting files and folders generated in the war folder (delete the folder that has the project name, if it exists, and the classes folder under /war/WEB-INF/classes). Hope this helps.
Check in your "Java Build Path" if you have the correct Default output folder (something like /target/project-name/WEB-INF/classes).
In Eclipse, do a "Clean Build".
Click on the google blue button in the Eclipse menu and select "GWT Compile Project..."
Make sure the GWT plugin is compiling your project by checking the compiler output. The GWT compiler outputs lots of things, for example you will always see something like "Compiling 6 permutations.... Compiling permutation 0..."
If you still have problems, try this page on setting up Eclipse with GWT: http://code.google.com/webtoolkit/usingeclipse.html
Thanks for your comments and suggestions. I re-installed Eclipse on Ubuntu and I installed plugin one more time and it works :)
So, be careful which version of Eclipse you use - Eclipse 3.4 has problem with GWT.

Resources