Can't build JavaScript universal Windows app - javascript

I have started a new project - javascript - windows universal app and without changing anything or adding any code I try to build it and run it but it wont with the following error:
Error : DEP0700 : Registration of the app failed. error 0x80080204: App manifest validation error: The document root element m:Package must be defined in the http://schemas.microsoft.com/appx/2010/manifest namespace. (0x80080204) App7
A similar issue was reported here and I tried renewing the license with project -> store -> aquire developer license to no avail. It seems to be that the actual problem has to be the document root element part which I'm not really familiar with as I haven't worked with Visual Studio before I tried to add xmlns:m="http://schemas.microsoft.com/appx/2010/manifest" to my package appxmanifest but that doesn't seem to have helped.
Heres the whole manifest:
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:m="http://schemas.microsoft.com/appx/2010/manifest"
IgnorableNamespaces="uap mp m">
<Identity
Name="155dc546-80c7-4275-b2a6-a2aa8ddec5f7"
Version="1.0.0.0"
Publisher="CN=FroboZ" />
<mp:PhoneIdentity PhoneProductId="155dc546-80c7-4275-b2a6-a2aa8ddec5f7" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>App7</DisplayName>
<PublisherDisplayName>FroboZ</PublisherDisplayName>
<Logo>images\storelogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10069.0" MaxVersionTested="10.0.10069.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application
Id="App"
StartPage="default.html">
<uap:VisualElements
DisplayName="App7"
Description="App7"
BackgroundColor="#464646"
Square150x150Logo="images\Logo.png"
Square44x44Logo="images\SmallLogo.png">
<uap:SplashScreen Image="images\splashscreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
Thank you for taking your time to read my question and even more so if you can help me with this problem!

Developer mode wasn't turned on in windows 10. I'm not sure what difference this makes but after turning this on I was able to build the project.

Related

React-Native-Crop-Image doesn't work on android , How to crop images on android and it should be same for ios also

I have tried this library react-native-image-crop-picker as suggested on this stackoverflow answer
I have followed each and every step mentioned here
Run npm i react-native-image-crop-picker#0.4.2
import ImagePicker from 'react-native-image-crop-picker';
then
ImagePicker.openPicker({
width: 300,
height: 400,
cropping: true
}).then(image => {
console.log(image);
});
Also in // file: android/settings.gradle have added the below code
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new
File(settingsDir,
'../node_modules/react-native-image-crop-picker/android')
Also as mentioned in the documentation have added required code in build.gradle & MainActivity.java file
But this is not working for me on Android but working perfectly on iOS . On Android I have given to crop images by scale type only not as flexible crop.
I think you have faced the problem for version issue. You should try react-native-amazing-cropper . It works same for both the Android and iOS.
I had the same problem. I found out that we need the following line in our AndroidManifest.xml file.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" ... >
...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="replace" />
Enjoy.

Xpages dojo charting breaking csjs

I just started using The Dojo charting feature in Xpages. After following this tutorial by Andrew Champion. I Found that the simple csjs script to create a pie chart does not work. It breaks on the creation of the Pie Chart in CSJS. Using most basic code for better readability.
makeCharts = function()
{
alert("test");
var pieChart = new dojox.charting.Chart2D("#{id:panel1}");
};
The alert in the code above does not run when I call the function in my Xpage. I Followed the tutorial exactly but had no results. Any help would be appreciated.
Xpage source code below:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" dojoParseOnLoad="true"
dojoTheme="true">
<xp:this.resources>
<xp:dojoModule name="dojox.charting.Chart2D"></xp:dojoModule>
<xp:script src="/scriptsChartDojo.jss" clientSide="false"></xp:script>
<xp:script src="/scriptsChartDojoCSJS.js" clientSide="true"></xp:script>
</xp:this.resources>
<xp:scriptBlock id="scriptBlock1"
value="XSP.addOnLoad(makeCharts);">
</xp:scriptBlock>
<xp:panel style="height:450px;width:450px" id="panel1">
</xp:panel>
</xp:view>
I don't think you can include server generated code in js files. If you open the scriptsChartDojoCSJS.js file in your browser, you will see that #{id:panel1} has not been altered.
Instead you can add the makeCharts function to your xp:scriptBlock.

Specifics on How Glassfish Server is Run with IntelliJ Debugger?

I'm curious as to how the IntelliJ debugger uses the domain.xml of my glassfish server and reports a webpage when requested.
Specifically, I have an IntelliJ project called blobGame that uses a Glassfish server that opens a webpage called blobGame when the artifacts .war and .ear are deployed.
Firstly, how are these artifacts deployed? When I deploy them, I MUST have the URL of the localhost be http://localhost:60836/blobGame_war_exploded, and localhost:60836/blobGame DOES NOT WORK, even if I change it in the debug configuration - here is my debugger info
Why is this? Why does the url have to be /blobGame_war_exploded? It cannot even be /blobGame_ear_exploded, as I see that also in the domain.xml.
Here is the snippet of domain.xml for my domain called "domain2":
<applications>
<application object-type="user" name="blobGame_ear_exploded" directory-deployed="true" location="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_ear_exploded/">
<property name="archiveType" value="ear"></property>
<property name="isComposite" value="true"></property>
<property name="appLocation" value="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_ear_exploded/"></property>
<property name="org.glassfish.ejb.container.application_unique_id" value="98074431158681600"></property>
<property name="defaultAppName" value="blobGame_ear_exploded"></property>
<module name="web.war">
<engine sniffer="ejb"></engine>
<engine sniffer="security"></engine>
<engine sniffer="weld"></engine>
<engine sniffer="web"></engine>
</module>
<engine sniffer="ear"></engine>
</application>
<application context-root="/blobGame_war_exploded" object-type="user" name="blobGame_war_exploded" directory-deployed="true" location="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_war_exploded/">
<property name="archiveType" value="war"></property>
<property name="appLocation" value="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_war_exploded/"></property>
<property name="org.glassfish.ejb.container.application_unique_id" value="98074431158812672"></property>
<property name="defaultAppName" value="blobGame_war_exploded"></property>
<module name="blobGame_war_exploded">
<engine sniffer="ejb"></engine>
<engine sniffer="security"></engine>
<engine sniffer="weld"></engine>
<engine sniffer="web"></engine>
</module>
</application>
</applications>
SECOND of all, why does the deployment still use previous artifacts (as I assume they are) when I redeploy or restart the server?
Specifically, when I press restart, I get the exact same HTML and javascript files I was left with before, and even if I edited the html or JS files during the time before my second debug.
(I add alert("test") in the new debug, but it does not show up in the new debug. When I access the index.html page independently the alert does show up).
Here is the index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>keyBoardDemo</title>
</head>
<body>
<canvas id="canvas" width="800" height="600" style="border:1px solid #000000;"></canvas>
<p id="main"></p>
<script type="text/javascript" src=resources.js></script>
<script type="text/javascript" src=canvas.js></script>
<script type="text/javascript" src=keyboard.js></script>
<script type="text/javascript" src=packethandler.js></script>
<script type="text/javascript" src=player.js></script>
<script type="text/javascript" src=websocket.js></script>
</body>
</html>
and here is the canvas.js that it calls:
alert("test 123"); //this is not called on the second redeployment!
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
Firstly, how are these artifacts deployed? When I deploy them, I MUST have the URL ...
By default, IDEA computes context root from the artifact name, by replacing unsupported characters with underscores. Thus, the 'blobGame:war exploded' artifact, by default gets 'blobGame_war_exploded' context root.
To change the context root for the artifact, you may want to open the 'Deployment' tab of the run configuration, check 'Use custom context root' and enter the desired value into the field
'Open browser' field on the 'Server' tab does not affect the server settings, it just allows you to open whatever URL you like after the server start. The field value defaults to the URL computed from the first artifact, but once user have changed it IDEA assumes that user knows better.
Specifically, when I press restart, I get the exact same HTML and javascript files I was left with before, ...
The expected sequence is as follows:
make a change to a resource
update the application on the server with the mentioned 'Update <> application' action: 'Update resource' choice should be enough for an exploded application, redeploy/restart may be needed for archive artifact
reload (refresh) the page, that uses the resource in browser
I suspect you're missing the last (3) step. Please note, step (2) only updates the resource on the server, and to see a change in browser (on client) you should reload the corresponding resources from server by refreshing the page manually.
Hope that helps,
I am going to redirect your second post to this answer

Custom Cordova plugin iOS index.js dosent recognise my .js file

I have written a custom Cordova plugin that brings have as a dependency "Media" plugin.
When i run "cordova plugin add "myPlugin"" the plugin is installed to the sample project however when in my index.js i try to init my plugin it does not recognise it and if i try to create "Media" object it does.
Here is my plugin .xml file :
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="cordova-plugin-MyPlugin"
version="1.0.0">
<name> MyPlugin </name>
<description>Cordova MyPlugin Plugin</description>
<author> MyPlugin </author>
<license>MIT</license>
<keywords> MyPlugin </keywords>
<dependency id="org.apache.cordova.media"/>
<js-module src="www/MyPlugin.js" name="MyPlugin">
<clobbers target="window.plugins.MyPlugin" />
</js-module>
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="MyPlugin">
<param name="ios-package" value="CDVMyPlugin" />
</feature>
</config-file>
<!-- Sources -->
<header-file src="src/ios/CDVMyPlugin.h"/>
<source-file src="src/ios/CDVMyPlugin.m"/>
<!-- iOS Frameworks -->
<framework src="libz.dylib" />
</platform>
</plugin>
Thanks for the help.
The problem apparently was in my "MyPlugin.js" file at the bottom of the file the line :
module.exports = MyPlugin;
Needs to be added then in the Index.js file (or the file of your choosing) add the following :
//Get a reference to the custom .JS file.
myCustomPlugin = cordova.require("cordova-plugin-MyPlugin.MyPlugin");
myPluginInstance = new myCustomPlugin(someParams,onSuccess,onError,null);
Now you can access the methods of your .JS file.
Credit to https://stackexchange.com/users/366553/marat-strelets for helping with the solution.

Firebreath function call

I am trying to call firebreath functions from my javascript file.Everything works fine if I call the firebreath functions using an html document with javascript functions and also for firefox version upto 28. For higher versions of firefox on calling the functions through plugin I get an error "TypeError:plugin.echo is not a function" (echo is an inbuilt firebreath function). Find the below code for reference.
overlay.xul
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/"?>
<overlay id="mypluginOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
<script type="application/x-javascript" src="chrome://myplugin/content/ngContent.js"/>
<vbox style="height:0;">
<html:object type="application/x-myplugin" id="myplugin" style="height:0;"></html:object>
</vbox>
</overlay>
ngContent.js
try
{
var plugin = document.getElementById('myplugin');
alert(plugin); // Output for firefox version upto 28 : <JSAPI-Auto Javascript Object>
//Output for firefox higher versions : [object HTMLObjectElement]
plugin.echo("qwerty");
}
catch(ErrorMessage)
{
alert(ErrorMessage);
}
Can anyone help me in this??? Thanks in advance....
EDIT:
Tried html:embed tag instead of html:object in overlay.xul.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/"?>
<overlay id="mypluginOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
<script type="application/x-javascript" src="chrome://myplugin/content/ngContent.js"/>
<vbox style="height:0;">
<html:embed type="application/x-myplugin" id="myplugin" style="height:0;"></html:embed>
</vbox>
</overlay>
It doesn't work either.

Categories

Resources