Strange Xamarin Forms Build Error for Android Project - android

I have seen a few questions about this error here on SO, but none pertaining to Xamarin Forms and VS2017, so this is not a duplicate.
I have a simple little project that demonstrates the rare use of constructors in XAML. I am getting the following build error:
Error: No resource found that matches the given name: attr
'android:keyboardNavigationCluster'
The error occurs in the file <project-name>/C, and my code contains zero references to this resource.
I am using a totally fresh re-install of VS2017, only now upgraded to v15.5.1, and have done nothing except delete an emulator left over from my previous installation that was not starting. I'm currently using the default Android_Accelerated_x86_Nougat (Android 7.1 API 25) emulator that was installed as part of the VS2017 install. I have made zero configuration changes in VS yet, this is straight 'out the box'.
The Xamarin Diagnostics 'mode' in the Output Window is empty, as no attempt has yet been made to deploy the app, because it won't build.
What can I look at and do about this?

I recreated the project from scratch in my new install of VS and now everything seems to work fine.

Related

Android resource compilation failed... Android Studio 4.0.1

i have recently installed Android Studio 4.0.1 on windows to start with app development. The ide was working well and i created some very small apps with it.. but recently the ide throws this error when trying to build the code (shown in image). it throws the same error even for the example "hello world" code that comes inbuilt with the Android Studio.
I tried reinstalling, and even downloading a fresh setup file and installed it, still the error remains.
The error is shown in the screen shot, it shows Android Resource compilation failed
I am new to this field, please help me in getting rid of this issue
you have an error in your xml file.
name="De" is missing the closing Quotation mark.
Be very careful with XML structure since sometimes it's hard to see the error.

Lime 5.2.1 / Android 4.3 : dlopen fails on stpcpy

I'm trying to build an empty HaxePunk project for Android to test the build chain, and while I'm never getting any error, all my attemps have crashed at run time with the same error message :
Error: dlopen failed: cannot locate symbol "stpcpy" referenced by libzlib.so...
I am running the executable on a pretty old phone with Android 4.3 on it ; a Sony Xperia M.
I have been doing a bit of research, and so far I mostly see the same things being repeated : update your NDK (I've been using the latest one from the android dev website and not the one lime setup android downloads), build for previous API versions (which I am also doing with <config:android target-sdk-version="18" /> in my project.xml file). So I don't know what I'm doing wrong, if anything.
Another thing I found is that I'm using the git version of HXCPP, and when I built the Android libs with neko build.n android in the project subdir, it was using -DHXCPP_ANDROID_PLATFORM=26 whereas the Lime build of my project is using -DHXCPP_ANDROID_PLATFORM=9, so that can't be good. However, I don't really know much about Android at all, but I have read that the SDK version and Android platform are two different things, or so I've read.
Any help with this will be much appreciated.
EDIT : Okay so something weird happened : up until now I was trying to install the APK manually by copying it to my phone's files and launching it from there, which kept crashing. I tried lime test android once without changing anything at all and it worked fine, and from then I could manually install the APK like I used to, and the error never happened again. I can't replicate it, but it's still an open case.

Android Studio reports "Could not identify launch activity: Default Activity not found" when building Kotlin projects

I'm trying to build an Android app using Kotlin and Anko. When I select "Run" in Android Studio I get the error:
Could not identify launch activity: Default Activity not found
Error while Launching activity
and the app does not start. I get this error with both the emulator and with a real phone.
To try and narrow down the problem I tried a couple of sample Anko projects, including android-anko-sample, and they all exhibit this same broken behavior.
I have other Android projects I've written in Java, and they run without this problem, which suggests that this is somehow a Kotlin or Anko specific issue. I can even switch back and forth between one of my Java apps and the "android-anko-sample" app linked above, and reproduce the problem with android-anko-sample consistently, while my Java app works correctly every time.
I have looked at other questions involving this error message, and the solutions posted were either not applicable or didn't help.
One thing I have noticed that's weird is that when I open AndroidManifest.xml (of any of these Anko apps) in Android Studio the names of the activities are shown in red, as if they are errors. Here's how the one from android-anko-sample looks:
Note that the app does get installed on the phone/emulator, and I can tap on the icon and run it. It just won't automatically start when I select run from Android Studio, which is pretty inconvenient.
How do I fix this issue?
I'm using:
Android Studio 2.1.2
Ubuntu Linux 16.04
Oracle JDK 1.8.0_131-b11
Code is here:
https://github.com/vsouhrada/android-anko-sample
The complete contents of a few of Android Studio's panes are available in this gist:
https://gist.github.com/xenomachina/e8027b385661038c3f020a543493eebf
This was caused by not having the Kotlin plugin installed in Android Studio.
To fix, go to File → Settings → Plugins → Browse Repositories, find "Kotlin", and install it.

IDE Fatal Error: Write access is allowed from write-safe contexts only

I have built simple Hello World application and ran it from IntelliJ on my Android device. When application starts, IDE error occur:
Write access is allowed from write-safe contexts only. Please ensure you're using invokeLater/invokeAndWait with a correct modality state (not "any"). See TransactionGuard documentation for details.
In the following window:
Simultaneously, application runs ok.
What is the reason and how to get rid of this message?
Got this same error after upgrading from a 2015 edition of IntelliJ to 2016.3.3.
After restarting the IDE, I took the suggested popup's guidance to upgrade Gradle, which then resynced and this error went away.
My project runs now and doesn't produce this error anymore.
If you are in a similar situation, I can recommend the above, as it removed this exact error in my setup.

Xamarin Android Build - No package specified

When creating a shared library application in Xamarin for iOS and Android, i can't install a blank project to either an Android device or the simulator. I get the following error:
Error - no package specified
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets:
Warning: Error: no package specified (test.Droid)
I have tried a variety of fixes but i don't really know what package it is referring to.
Any ideas?
Had same problem. The worst part is that there is not too much to show just says deploy failed with one error message: no package specified. After spending hours looking thru the build logs. It boiled down to one very simple solution:
Repair your Xamarin installation.
Make sure Visual Studio is closed.
Go to Apps & Features.
Find Xamarin in the list.
Click Modify.
Choose the repair option.
That's it.
P.S. By me this trouble started when I moved around the SDK from folder to another. I was consolidating the SDK used by Xamarin with two(!) other ones used by Android Studio.

Categories

Resources