How to configure plugin "cordova-plugin-screen-orientation" in config.xml - phonegap-plugins

cordova plugin add cordova-plugin-screen-orientation
After I fetched the plugin cordova-plugin-screen-orientation with the line above I looked inside the config.xml and I couldn't find a similar line like below for the plugin.
<gap:plugin name="org.apache.cordova.media-capture" />
I already tried
guessing the plugin id/name (PhoneGap Build kept saying the plugin is unsupported):
<gap:plugin name="org.apache.cordova.screen-orientation" />
<gap:plugin name="cordova-plugin-screen-orientation" />
The last line is the plugin id/name from the plugins plugin.xml.
to find the plugin id/name on the sites below:
build.phonegap.com/plugins
plugins.telerik.com/cordova
cordova.apache.org/plugins
to get help by making an issue at the repository of the plugin (the issue has been deleted so I removed the link to the issue)
searching on stackoverflow and google with:
configure plugin phonegap
adding plugin to phonegap
adding src="npm":
<gap:plugin name="cordova-plugin-screen-orientation" src="npm" />`
Can someone tell me the plugin id/name or how to configure the plugin in the config.xml?

The solution is replacing src="npm" with source="npm".
<gap:plugin name="cordova-plugin-screen-orientation" source="npm" version="1.4.0" />
Credits go to https://github.com/bau720123 for giving me the solution in the issue I created on GitHub. The issue is deleted so I can't post a link to it.
For more info on how to configure a plugin in the config.xml go here:
http://docs.phonegap.com/phonegap-build/configuring/plugins/

Related

C# - why costura and fody doesn't work to me?

(Translator used.)
I was making an exe file using Costura and Fody. However, if the dll file is missing, it cannot run. And there is a warning in my Visual Studio.
Warn:
FodyPackageReference Fody: The package reference for Costura.Fody is missing the 'compile' part in the IncludeAssets setting; it's recommended to completely remove IncludeAssets
I have this warn, too. But it works fine for me. So it's not the warn that leads to your issue.
In my opinion, maybe it's because the costura version does't fit your project. You can try an older version.
As for me, my project is using .NET Framework 4.6, and the latest costura.fody 5.3 version isn't compatible. But the 5.2 work fine.
And how to remove the warn:
(edit the csproj file)
Right-click on your project in solution explorer and select Unload
Project Right-click on the project (tagged as unavailable in
solution explorer) and click "Edit yourproj.csproj". This will open
up your CSPROJ file for editing.
find below and comment "IncludeAssets" line as below(by adding <!-- -->)
<ItemGroup>
<PackageReference Include="Costura.Fody">
<Version>5.2.0</Version>
<!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
After making the changes, save, and close the file. Right-click again on the node and choose
Reload Project when done.
Looks like previous answer, I got rid of the warning this way:
Double click on project node
In CSPROJ file add "compile;":
<IncludeAssets>runtime; compile; build;.....
Reload project
Actually, the error message tells you what to do:
"... it's recommended to completely remove IncludeAssets".
More specifically, in your project file ( .csproj or .vbprog ) find where it says as an example:
<PackageReference Include="Fody">
<Version>6.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
and change it to:
<PackageReference Include="Fody">
<Version>6.3.0</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
(i.e. remove the <IncludeAssets .....> line entirely).
Doing this, as applicable, for both costura and fody.

WebStorm has marked all files in a directory as non-project files

WebStorm has marked all files in a subdirectory of my project (the server portion of the root) as non-project files.
It happened sometime during my conversion to Babel and then again to TypeScript. I've removed the TypeScript stuff, wondering if it's something to do with that configuration. I believe it's just a WebStorm setting somewhere - because my tests run, builds work, all that.
Whenever I refactor or rename a file it says:
"Selected element is used from non-project files. These usages won't be renamed. Proceed anyway?"
It also highlights the code in these files differently.
Each of these file's icons has a small x in the top corner.
In their docs it says that these are " non-project files (e.g, library sources, external sources etc." This makes me think at some point I just marked a whole folder external at some point, thought I don't know where that could be.
Update I've tried deleting .idea folder and then running invalidate cache and restart. This didn't fix it either.
The myProject.iml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Close all Webstorm windows and from project folder in terminal run:
rm -rf .idea
Note: deleting from within Webstorm is not enough.
I had the same problem and none of these solutions didn't work.
Just right-click on the folder that has been marked as none-project, then click on Mark directory as, then click on Cancel Exclusion or Not Excluded and enjoy features of project-files :'))
screenshot of: how to mark none-project folder, as project folder

How to add plugins to cordova/phonegap app without using command npm?

I'm wondering if there is any convenient way to add plugins to hybrid app without using npm. For example I've created a phonegap app using their program so I did't have to use npm commands. But now I want to add this plugin to my app "cordova-plugin-crosswalk-webview" and I can't because constantly pop up different errors. I've searched for the solutions in internet but the reasons are different (always something in my windows is missing). So I've decided to reinstall windows and install everything afresh. But I thought that is a good question anyway. So is there any other way to do it? And If some one would be so kind and do for me a sample corova app with already added crosswalk plugin I would be happy because I will reinstall my windows next week.
I don't think that there is any other convenient way. And respecting your problem just add this code:
<preference name="android-build-tool" value="gradle" />
<gap:plugin name="phonegap-plugin-push" source="npm" version="1.3.0" />
<gap:plugin name="cordova-plugin-crosswalk-webview-pgb-adapt" source="npm" version="1.4.0-dev-11"/>
to your config.xml

cordova custom plugin use 3th party JAVA lib gradle

I want to reference a 3th party library:
import com.googlecode.mp4parser.authoring.Movie;
but in android studio, gradle puted the library in C:\Users\flieks\.gradle\...
Now how do i "export" the plugin project?
i want to have mp4parser somewhere in folders src\android\main.java
Greetings
Felix
You can reference a Gradle file in your plugin to allow you to pull in other libraries (if I'm understanding your question correctly). Check out plugin.xml in the crosswalk-webview plugin for an example on how to add one in:
https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/blob/master/plugin.xml
Once you do that you can import the class in your plugin code.
adding this to the plugin.xml did the trick
<platform name="android">
<config-file parent="/*" target="res/xml/config.xml">
<feature name="Mp4Parser">
<param name="android-package" value="com.catwalk.mp4parser.Mp4Parser" />
</feature>
</config-file>
<config-file parent="/*" target="AndroidManifest.xml" />
<source-file src="src/android/Mp4Parser.java" target-dir="src/com/catwalk/mp4parser/Mp4Parser" />
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />
</platform>
and this in same folder as the JAVA file
dependencies {
compile group: 'com.googlecode.mp4parser', name: 'isoparser', version: '1.1.7'
}

Can't compile project after adding SFML.NET by Nuget

After adding SFML.NET through Nuget Packge manager I got the following error:
Error 4 The "UnzipNuspec" task was not found. Check the following: 1.) The name of the
task in the project file is the same as the name of the task class. 2.) The task class is
"public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is
correctly declared with <UsingTask> in the project file, or in the *.tasks files located
in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
I'm using Visual Studio 2012.
As pointed out in other similar questions, I've tried to close and open MSVS, it didn't helped.
I also checked out the build tools path in the registry, and it points to right directory.
I tried to install and uninstall Nuget packeage.
I found out that error possibly somehow connected to it's dependency : Baseclass.Contrib.Nuget.Output, but I can't find out how to fix it.
It's a bug in their build script.
Go to the packages folder for your solution and locate the following file:
Baseclass.Contrib.Nuget.Output.1.0.6\build\net40\Baseclass.Contrib.Nuget.Output.targets
Around line 84 in that file you'll find a couple of <Using Namespace=... /> tags. Add this after those, before the <Code...> tag:
<Using Namespace="System.Threading" />
I've reported this on their github issues list as well.

Resources