Location of "network_security_config.xml" file in Flutter - flutter

Been trying to find out file named "network_security_config.xml" in flutter. I have no idea where to find it. I do not see any thread here. Sorry for the silly question but can anyone help me since I am going to implement appodeal plugin.
There is only one step which confusing.
"In your network_security_config.xml file, add base-config that sets cleartextTrafficPermitted to true :"
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>
Source: https://pub.dev/documentation/stack_appodeal_flutter/latest/

Add the Network Security Configuration file to your AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application
...
android:networkSecurityConfig="#xml/network_security_config">
</application>
</manifest>
Put your XML configuration under android/app/src/main/res/xml/network_security_config.xml,
In your network_security_config.xml file, add base-config that sets cleartextTrafficPermitted to true :
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>

Related

Flutter http doesn't work in releasebuild

On debug everything works fine. But if I create a releasebuild the Flutter http-libary doesn't work.
I've the internet-permission in my androidmanifest.
Currently I use Flutter 2.5.0 and http 0.13.3.
I've already created a new project, but it doesn't work there either.
<application
android:name="io.flutter.app.FlutterApplication"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
android:label="Appname"
android:icon="#mipmap/ic_launcher">
................
</application>
Then inside res folder, create xml folder and add network_security_config.xml
Inside network_security_config.xml file, you may enter specific http url and you may use local api also.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">example.uz</domain>
<domain includeSubdomains="true">example2.uz</domain>
<domain includeSubdomains="true">10.112.52.30</domain>
<domain includeSubdomains="true">192.168.12.81</domain>
</domain-config>
</network-security-config>

Configuration of aws-messaging:annotation-driven-queue-listener

I have configured as shown but get
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aws-messaging:annotation-driven-queue-
listener'.
context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
xmlns:aws-messaging="http://www.springframework.org/schema/cloud/aws/messaging"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cloud/aws/context
http://www.springframework.org/schema/cloud/aws/context/spring-cloud-aws-context.xsd
http://www.springframework.org/schema/cloud/aws/messaging
http://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd">
<aws-messaging:annotation-driven-queue-listener/>
</beans>
In the pom I have
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
I have configured as shown but get
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aws-messaging:annotation-driven-queue-
listener'.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
xmlns:aws-messaging="http://www.springframework.org/schema/cloud/aws/messaging"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
ht tp://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cloud/aws/context
http://www.springframework.org/schema/cloud/spring-cloud-aws-context.xsd
http://www.springframework.org/schema/cloud/aws/messaging
http://www.springframework.org/schema/cloud/spring-cloud-aws-messaging.xsd">

Cannot create Azure Service Project Package using Azure CmdLets

I have a cloud service project in VS 2013 RTM.
I use Save-AzureServiceProjectPackage -Local command to generate CSPKG package. I am getting following error. Not sure why. Can anybody help.
Here is my Cloud CSCFG File -
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2013-10.2.2">
<Role name="WebRole1">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
And here is my Service Definition CSDEF file -
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-10.2.2">
<WebRole name="WebRole1" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WebRole>
</ServiceDefinition>
Appreciate any help.
The latest version of Windows Azure PowerShell doesn't support packaging VS projects. The new version which will be early December 2013 will have this support.

'Spring.xml' IOException issues with migrated project from Eclipse to IntelliJ

I have pulled a Java project from TSF which another colleague created using Eclipse, however, whenever I open the project in IntelliJ it get the following runtime exception:
Exception in thread "main"
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource
[spring.xml]; nested exception is java.io.FileNotFoundException: class
path resource [spring.xml] cannot be opened because it does not exist
...
...
I have used Maven to download all the project dependencies which seem to have worked fine as I am not getting any compile time exceptions.
I have uploaded most of the project configuration settings to this imgur album, it should hopefully help.
Main.java
ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
Spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.3.xsd">
<bean id="ApplicationConfiguration" class="com.XXX.YYY.ZZZ.ApplicationConfiguration" />
<bean id="TableFactory" class="com.XXX.YYY.ZZZ.TableFactory">
<constructor-arg ref="ApplicationConfiguration" />
</bean>
<bean id="ItemFactory" class="com.XXX.YYY.ZZZ.datagen.ItemFactory"/>
<bean id="ItemWritersPool" class="com.XXX.YYY.ZZZ.ItemWritersPool">
<constructor-arg ref="ItemWriterFactory" />
<constructor-arg ref="ApplicationConfiguration" />
</bean>
<bean id="ItemWriterFactory" class="com.XXX.YYY.ZZZ.ItemWriterFactory">
<constructor-arg ref="ApplicationConfiguration" />
<constructor-arg ref="TableFactory" />
<constructor-arg ref="ItemFactory" />
</bean>
<bean id="ItemReadersPool" class="com.XXX.YYY.ZZZ.ItemReadersPool">
<constructor-arg ref="ItemReaderFactory" />
<constructor-arg ref="ApplicationConfiguration" />
</bean>
<bean id="ItemReaderFactory" class="com.XXX.YYY.ZZZ.ItemReaderFactory">
<constructor-arg ref="TableFactory" />
</bean>
</beans>
Project.iml
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<conelement value="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration>
<fileset id="fileset" name="Spring Application Context" removed="false">
<file>file://$MODULE_DIR$/src/spring.xml</file>
<file>jar://$MAVEN_REPOSITORY$/io/netty/netty/3.6.3.Final/netty-3.6.3.Final.jar!/org/jboss/netty/container/spring/beans.xml</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/cache/annotation/AbstractCachingConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/context/annotation/LoadTimeWeavingConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/context/annotation/MBeanExportConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/cache/annotation/ProxyCachingConfiguration.class</file>
<file>jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar!/org/springframework/scheduling/annotation/SchedulingConfiguration.class</file>
<file>file://$MAVEN_REPOSITORY$/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE.jar</file>
</fileset>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
[-- some items manually removed --]
<orderEntry type="library" name="Maven: org.springframework:spring-core:3.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:3.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:3.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:3.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:3.2.3.RELEASE" level="project" />
[-- some items manually removed --]
</component>
</module>
Any advise and/or suggestion will greatly appreciated. Thanks in advance!
Everything seems ok in your config so I checked using a small project and it appears that the problem may come from the redundant namespaces you are using in your XML headers.
Try modifying the following this:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.3.xsd">
To result in something like this:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
If that does not work you can also tweak your .iml file by doing the following:
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true". You can test quickly by replacing true with false and let IntelliJ reload your project.
I don't know why IntelliJ ignore your spring.xml file, but if you use 2 separate directories for sources and resources, as Maven suggests, your problem should disappear.
You should also create the directory src/main/resources and place your spring.xml file there.
Hope this helps.
Sometimes this can be a problem with the working dir. This blog post explains the problem and how to fix it.
IntelliJ differs from Eclipse in that it sets the working directory to project root which may not be the same as the top level directory of the module you are working on.
This can be fixed in the run configurations by setting the working directory to $MODULE_DIR$.
If this helps maybe set the working directory in Default JUnit run configuration as well as
and fixing all remaining run configurations.

Build folder stays empty

Hi Im trying to follow the tutorial here regarding Struts. I have followed the tutorial exactly but am getting an HTTP 404 error. I know this error basically means that the resource can't be found be the the IDE.
I noticed that the 'Build' folder is actually completely empty - so I'm guessing that it should have automatically created a runnable project based on my project specifics and this is actually where the server looks in order to run an application.
So how do I go about manually generating this file? Should I drag all the resources in? Java classes, JSP files and so? If not how do I configure it to automatically build?
Cheers
EDIT
Have added what I think will be necessary to help solve this:
Web.xml Located in the WEB-INF folder, next to lib
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts2 Application</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
Struts.xml Located in a src folder called resources in the Java Resources folder
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources" value="ApplicationResources" />
<package name="default" extends="struts-default" namespace="/">
<!--
If we changed from the default execute() method, which struts looks for
to say authenticate(), then we would have to specify this in the action
method below like this:
<action
name="login"
method="authenticate"
class="net.viralpatel.struts2.LoginAction">
</action>
-->
<action name="login" class="net.viralpatel.struts2.LoginAction">
<result name="success">Welcome.jsp</result>
<result name="error">Login.jsp</result>
</action>
</package>