I'm following the guide for setting up the Android N Preview https://developer.android.com/preview/setup-sdk.html
In "Update or Create a Project" Google says I need to have 24.0.0 platform tools.
Just be sure that you've updated your project to use Android SDK Build
Tools 24.0.0 and Android SDK Platform-Tools 24.0.0.
I have installed the new SDK Platform: Android 6.X (N), API Level 24, Revision 1. However when I open SDK Tools the only Android SDK Platform-Tools version is 23.1.
I have updated my build.gradle for Android 24 and for Jack and Java 8 (see).
Everything works great on Android 24 simulator but crashes on a device or simulator running Android 22/23 (less than 24) with the following error:
java.lang.NoSuchMethodError: No virtual method
stream()Ljava/util/stream/Stream; in class Ljava/util/ArrayList; or
its super classes (declaration of 'java.util.ArrayList' appears in
/system/framework/core-libart.jar)
I suspect the cause is having SDK Platform-Tools version 23.1.0 instead of 24.0.0 but if there is another solution i'd be happy to hear it.
Edit
Installing platform tools 24.0.0 rc1 did not fix the crash.
I'm not sure what else to try given that I have followed all the instructions to setup the preview and the Jack compiler.
but crashes on a device or simulator running Android 22/23 (less than 24) with the following error
java.util.stream.Stream was added in API Level 24. This class cannot be used on older devices.
Certain Java 8 features, like lambda expressions, may work on older devices, but not classes that were introduced in Android N.
Just select the show package details and then you can find all the versions. Refer to the attached image
Asuming you have Android Studio 2.1
Launch the standalone SDK manager.
From there Android N API 24 should be available to install
Your API level 24 app runs OK with Android 24 (virtual) device but doesn't work with pre-24 device - so everything is exactly as one would expect.
Related
I just switched from IntelliJ to Xamarin and, man, am I regretting it. Can anyone help me with this error?
I have a Xamarin.Forms project with .NET standard sharing strategy. I'm receiving the error:
com.xamarin.forms.platform.android does not exist
followed by about 100 errors:
... cannot find symbol.
If I create a new project, the errors still occur.
Android manifest
Minimum version is Android 8.0 (API Level 26 -Oreo)
Target version is the same.
I have also tried each and both with Use Compile using SDK version.
Android SDK
Installed platforms are Android SDK Platform 27 and Android 8.0 - Oreo
Installed Tools are Android SDK 26.1.1 and 27.0.1.
Build tools are all from 26.0.0 to 27.0.3.
Emulator 27.1.7
NuGet - Solution
All packages updated.
Xamarin.Forms version v2.5.0.280555
Android Emulator Manager
Operating System is Android 8.0 - Oreo(API 26)
The only advice I can find is on SO ... and it is to check manifest versions. I'm at a loss now and am unable to work on any project, have lost three days trying to solve it ... and am very close to switching back to IntelliJ. Does anyone have any ideas?
I am developing an Android app in Visual Studio. In the Android SDK manager, all API's from API level 23 (Android 6.0) to API level 25 (Android 7.1) are installed.
But when I open the project properties in Visual Studio, the "Compile using Android version" option is showing apis only till 23(Android 6.0). I want to target 7.1 as most of the smartphones will now have it.
There are another problem if I go with Android 6.0. Some packages like Xamarin.Firebase.Messaging fails to install with the following error.
Install-Package: Could not install package 'Xamarin.Firebase.Messaging 42.1001.0'.
You are trying to install this package into a
project that targets 'MonoAndroid,Version=v6.0', but the package does not contain
any assembly references or content files that are
compatible with that framework. For more information, contact the package author.
I can see that all options available under API level 25 are installed in SDK manager. Kindly help me so that i can target Android 7.1 from the Visual Studio Android app. Thanks
Is your Xamarin installation up to date? I suspect that your version of Xamarin.Android is 6.x which means that you won't be able to target Android 7.0 or 7.1 even if they are installed through the SDK manager. You can check the version from Help > About Microsoft Visual Studio.
For example, my version is 7.1.0.19 and I'm able to target Androd 7.1 just fine.
To check for updates, you should open Tools > Options > Xamarin > Other and click Check now.
Update for Visual Studio 2017:
If you're using Visual Studio 2017 or newer, Xamarin updates are delivered as part of Visual Studio updates. To manually check for updates, go to Tools > Extensions and Updates... In the left hand menu, open Updates and select Product Updates. If there are updates available, they will be shown on this list.
In Visual Studio 2017 preview there is an improved Google Android emulation support with a new Android emulator that's built into Visual Studio (this supercedes the Visual Studio Emulator for Android):
I checked it this morning and it had Android emulators up to API 27 including Oreo.
However, I did try to trigger API 28 P-Type even switching the SDK Manager from the Microsoft repository to the Google repository but it still didn't show up, but, at least you got everything you need up to API 27.
References:
https://www.visualstudio.com/vs/preview/
https://blog.xamarin.com/3-reasons-to-try-visual-studio-2017-version-15-4-previews/
I am absolutly new in Android development and I have the following problem trying to build a sample project that I have downloaded from Internet.
When I try to build it I obtain the following error message:
Error:Cause: failed to find target with hash string 'android-18' in: C:\Users\Andrea\AppData\Local\Android\sdk
Install missing platform(s) and sync project
So I search online and I found this SO link: Android studio - Failed to find target android-18
Ok so I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version o the Android framework ?(is it the SDK considerable as a framework or what?)
So, on Android Studio can I install different version of the SDK?
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ? I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
I will explain the problem a bit for you and then provide you with the solution.
You are facing this problem, because your project is targeting API level 18 to compile the project. So you MUST have API 18 SDK installed to compile the project.
This is why the IDE is complaining that,
Install missing platform(s) and sync project
The SDK is not the framework. The Android framework is same all over, but with different API levels new updates are pushed to the SDK, the latest being API 23, Marshmallow.
You should not download an older SDK to compile the project.
Always try to use the latest SDK available to work with. So, just head over to your build.gradle file or AndroidManifest.xml file and change the compileSdkVersion to 23.
You can either change the compileSdkVersion version in build.gradle to 23 or whatever version you have in your local machine
You can obtain the API Level 18 from the SDK Manager.
I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version of the Android framework ?
Yes, you have a newer version of the SDK.
on Android Studio can I install different version of the SDK?
Yes, that is what the SDK Manager is designed for
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ?
It is defined. Check either the AndroidManifest.xml or the build.gradle file in the module for the app (not in the project root). You should see some combination of minSdk, targetSdk, and/or compileSdk with a number after it. Since you are getting an error about missing SDK 18, then that number will be 18.
I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
The support libraries are separate from the core SDK. You cannot run SDK 23 specific code on devices that have a version less than 23, therefore, to be safe, it is recommended that you start with downloading SDK 18, then run it, then try updating the compileSdkVersion number.
I get a aapt.exe exited with code 1073741819 error when I try to build a new blank android app in VS2015 Community Edition.
Also a file obj\android\bin\packaged_resources does not exist error.
I have changed nothing and this happens.
I've tried looking this up and have found about:
Changing the output verbosity to Diagnostic [Doing this has not yielded anything useful that I can understand]
Ensuring all concerned files and directories contain no spaces or any special characters/symbols.
Installing all the latest Android SDKs.
The solutions I've been able to find (which usually include checking names of files and directories along with re-installing Visual Studio all together) do not resolve the issue. I have also tried Repairing VS to no avail as well as re-running the Xamarin for VS installer which also had no effect.
I would rather leave re-installing VS entirely as a last resort since it is a large download (+20GB).
-EDIT-
Most threads I've looked up talk about resolving erroneous syntax, missing parameters, calls to variables that were not declared, incorrect id tags, spaces or dashes in filenames etc. All usually in xml or layout files.
That is not the case for me. I get these errors as soon as I create a new project. I've checked the default code and it does not seem to have any errors in and of itself.
What is also a common remedy is to set output verbosity to 'normal' or 'diagnostic'as doing that would usually point out the culprit (often a syntax error). This has not worked for me either
Also I am up-to-date with SDK packages.
Remove SDK 24 using the Android SDK Manager. Technote on this exact issue here - https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/ . Totally removing "24" from my machine cleared it. Just changing targets did not.
From android SDK manager just make sure that at least one Android SDK Build Tools for your used API is installed
for example for version 22.0.1 , check the below image
I know this question is ancient, but I stumbled on it earlier today with a nearly identical problem. The answers and comments got me nearly all the way to a solution, and since this never seemed to wrap up neatly I thought someone might benefit from my flailing.
I'm pretty new to Xamarin and most other things programming and this is my first Stack answer, so my apologies in advance if I'm off base or out of bounds with anything.
Since it appeared at least some of the problem is conflicting APIs, I set the properties of the application to Android 6.0 (API 23) for compiling and targeting to simplify troubleshooting. See this screencap. This eliminated one instance of code 1073741819 right off the bat.
I then deleted everything that wasn't related to API 23 or Android 6.0 via the SDK manager. Including, rookie mistake, Android SDK Tools in the tools folder. The solution compiled error free (yay!) but my Android tools were gone...something I didn't notice until I tried to get a list of packages from the SDK Manager (that was no longer functional).
I ended up downloading a new set of command line tools from Android and placing the extracted "Tools" folder back into ProgramFiles(x86)\Android\android-sdk. This fixed my mistake with SDK Tools, and added additional packages to my "API 23 only" lineup--but the solution still builds error free.
I currently have the below packages installed per the Android SDK manager and solution builds as expected, so one can use the SDK Manager to modify the packages instead of doing full removal and reinstall of the tools folder (like I bumbled into).
Tools
Android SDK Tools : Rev 25.2.3
Android SDK Build-tools : Rev
23.0.3
Android SDK Build-tools : Rev 23.0.2
Android SDK Build-tools : Rev 23.0.1
Android SDK Build-tools : Rev 22.0.1
Android SDK Build-tools : Rev 21.1.21
Android 7.1.1 (API 25)
Sources for Android SDK : API 25 Rev 1
Android 6.0 (API 23)
SDK Platform : API 23 Rev 3
Google APIs : API 23 Rev 1
Google APIs ARM EABI v7a System Image : API 23 Rev 7
Google APIs Intel x86 Atom System Image : API 23 Rev 12
Sources for Android SDK : API 23 Rev 1
tl/dr:
The wrong combo of Android APIs installed seem to break the aapt.exe process, as does targeting/compiling in a version you don't have packages for or have conflicting packages for.
Setting application properties to a single desired Android version, and
replacing the ProgramFiles(x86)\android-sdk\tools folder with the latest download of command line tools from Android allowed it to build error free.
So I just reinstalled the lastest version of Xamarin after a clean install of my laptop. There were no errors during the Xamarin install, so everything seemed okay. However, I went to open an existing project based on Android 3.1 (API 12) and got the following error when I compiled:
Unsupported or invalid $(TargetFrameworkVersion) value of 'v3.1'. Please update your Project Options.
Checked out my project properties and found that both the Compile and Target Android version combos were blank. I have several versions listed in the combos, but v3.1 (API 12) is nowhere to be found. When I look in the Android SDK Manager, it shows that Android 3.1 (API 12) is installed. Anyone know why it would be missing in Visual Studio/Xamarin?
We removed some of the API levels. Your application can still run on these completely fine, but you can't use them to Compile against or to Target. You will want to set your Target Framework the latest version API 21 currently and set the Minimum to the minimum you want. I usually recommend Target = 21, Minimum either 15 or 10 based on AppCompat that you need.
http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/#Removal_of_API_Levels