I have a fresh installation of Visual Studio 2017 (version 15.3.5). When opening axml files on Xamarin Android sample projects, I kept encountering the following error:
java.lang.NullPointerException
at mono.android.DesignerException.fromThrowable(DesignerException.java:30)
at mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:187)
at mono.android.DesignerSession.load(DesignerSession.java:239)
at mono.android.DesignerSession.processMessage(DesignerSession.java:704)
at mono.android.MessageListener.executeMessage(MessageListener.java:88)
at mono.android.MessageListener$Runner.run(MessageListener.java:44)
at java.lang.Thread.run(Thread.java:748)
Only the Designer view throws such error. The Code editor works fine. Axml content:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="#+id/DataHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="DataHeader"
android:layout_margin="10dp"
android:textStyle="bold"
android:paddingStart="50dp"
android:paddingLeft="50dp" />
</LinearLayout>
This error happens on multiple Xamarin Android projects. Visual Studio 2017 is newly installed. Please help.
Related
I have an issue with this code. Cannot fathom what is wrong
Does someone have a clue?
Adobe Animate when publishing apk. Error creating files. Namespace is invalid in the application descriptor file.
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<application xmlns="http://ns.adobe.com/air/application/26.0">
<id>NorskRadioUtenAir</id>
<versionNumber>1.0.0</versionNumber>
<versionLabel/>
<filename>NorskRadioUtenAir</filename>
<description/>
<name>NorskRadioUtenAir</name>
<copyright/>
<initialWindow>
<content>NorskRadioUtenAir.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>false</fullScreen>
<aspectRatio>portrait</aspectRatio>
<renderMode>cpu</renderMode>
<autoOrients>false</autoOrients></initialWindow>
<icon/>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<android>
<manifestAdditions><![CDATA[<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application>
<meta-data android:name="com.google.android.gms.version" android:value="4323000" />
<!-- should be android:value="#integer/google_play_services_version" -->
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>]]></manifestAdditions>
</android>
<extensions>
<extensionID>com.pozirk.ads.AdMob</extensionID>
</extensions>
</application>
Since I do not have Mac and iPhone, the only option for me is to use Ionic Cloud to build my native binaries. However, first I wanted to play with it and see how will it work with android builds.
My application uses https://github.com/fechanique/cordova-plugin-fcm
So I can build application with ionic cordova build android and run it on my emulator without any problems. However if I execute ionic package build android and then ionic package info I get message that my build FAILED.
Examine this failure with ionic package BUILD_ID I get this message:
Error: cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder.
So, looks like that my google-services.json does not get uploaded to the cloud. So searching I find few posts of people that had same problem but none of them provided me with solution. I also found this:
https://cordova.apache.org/docs/en/latest/config_ref/index.html#resource-file
So I have tried to tell to ionic to include this google-services.json file with package like this:
<?xml version='1.0' encoding='utf-8'?>
<widget id="me.citybeep.partnerapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<!-- ... -->
<platform name="android">
<!-- ... -->
<resource-file src="google-services.json" target="platforms/android/google-services.json" />
</platform>
<!-- ... -->
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-fcm" spec="^2.1.2" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-sqlite-storage" spec="^2.0.4" />
<plugin name="de.appplant.cordova.plugin.local-notification" spec="^0.8.5" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
</widget>
And also tried this:
<resource-file src="google-services.json" target="google-services.json" />
But we no success, however now I get another message:
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: me.citybeep.partnerapp
Name: City_Beep_Partner
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Error: Source path does not exist: google-services.json
I think this error is just that google-services.json did not get uploaded.
I am really dependent now on this plugin and using Ionic Push notifications is not an options at the moment...
So is there any way to tell ionic to include this google-services.json file when uploading to the cloud (and also .plist file). And I repeat, it is not problem with google-services.json file or my firebase project as everything works fine while performing build on my machine.
i tried several solutions, but the only one worked for me was specifying src and target with relative path of the google-services.json.
In your case change
<resource-file src="google-services.json" target="platforms/android/google-services.json" />
to
<resource-file src="platforms/android/google-services.json" target="platforms/android/google-services.json" />
this should work.
Recently I tried to add Map Fragment to my Monodroid app written with Xamarin + MvvmCross.
When I modify manifest in accordance with one of the mapping guides Google Maps in Monodroid Apps to:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionName="1.3.0.0" android:versionCode="1" package="MonoDroid.drdApp">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="MonoDroid.drdApp.permission.MAPS_RECEIVE" />
<permission android:name="MonoDroid.drdApp.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<application android:label="Droid App" android:icon="#drawable/icon">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my_valid_key_goes_here" />
</application>
</manifest>
I got the following error (runtime error):
Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/MonoDroid.drdApp-Signed.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
I discovered that the manifest line which generates the error is:
<permission android:name="MonoDroid.drdApp.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
but this line is mentioned in almost every guide I found related to google maps for Android.
I'm not sure what this line does and not sure if app will work without it (currently it doesn't and this line is one of the suspects.
Could someone clarify how to deal with that manifest line?
I'm not 100% certain, but I suspect that the problem is in using a capital letter in your package name.
Try monodroid.drdapp instead - this may clear the error.
(Or better still - use the company name as part of the manifest)
I'm trying to use NLog in an F# console application, I've managed to get it working using a configuration section in App.config however I can't get it working using a stand-alone NLog.config file. My NLog.config file is in the app route, just under App.config and the contents are:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
<targets>
<target name="stdFile" xsi:type="File" fileName="c:/temp/compliant.log"/>
<target name="display" xsi:type="OutputDebugString"/>
</targets>
<rules>
<logger name="compliant.mail.*" minlevel="Debug" writeTo="stdFile,display" />
</rules>
</nlog>
What am I doing wrong?
Also, intellisense isn't working for the xml even though I have included the xsd. :(
In your project, in the Properties for NLog.config, do you have NLog.config marked as "Copy Always"?
I downloaded the BlackBerry 10 jQuery Mobile theme and I wanted to try how it works on the Dev Alpha.
I created this config.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0" rim:header="JQKS">
<author href="http://www.dandandin.net/"
rim:copyright="Copyright 2012 Dandandin.net">Dandandin.net</author>
<name>JQ Kitchensink</name>
<description>An app to test jquery</description>
<icon src="img/generic_81_81_placeholder.png" />
<content src="index.html"/>
<feature id="blackberry.invoke" version="1.0.0"/>
</widget>
and I placed it on /kitchensink
Then I packaged /kitchensink and loaded on my dev alpha, but I get this when I launch it:
I can press OK, but the application is frozen.
If I load it on my local webserver, and browse from the dev alpha it works, what's wrong?
In order to make it work, you have to update to the latest 1.0.3.8 SDK.
I had 1.0.2 and it didn't work.