Error building default Native-Activity Android Project in Visual Studio 2015 - android

I am attempting to build the default project that is generated in VS 2015 for template type Cross Platform -> Native-Activity Application (Android) but immediately receive an error during build:
Output:
2> BUILD FAILED
2> C:\Users\T\AppData\Local\Android\sdk2\tools\ant\build.xml:538:
Unable to resolve project target 'android-19' :
Application Manifest:
The ApplicationManifest.xml file has the following settings:
uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"
VS Options
Tools -> Options -> Cross Platform -> C++ -> Android SDK, Android NDK and Java SE Development Kit paths have been updated to match the settings I used successfully in Android Studio (for a different but equally simple native project). And the fourth path Apache Ant points to the newest version I just installed:
SDK 6.0 (API Level 23)
JDK 8.0
Ant 1.9.6
I have extensive VS experience (C# / C++) and good (but rusty) experience with Android/Java but no experience using VS to build for Android.
I am confused by the error in general, but am particularly confused because of the API level 19.
Any ideas about how to fix this?

Problem solved. When the Visual Studio solution is generated there are two projects added: [name].NativeActivity (C++) and [name].Packaging (Java).
Both project's properties allow Target API Level to be defined. Repeat these steps for both projects:
Solution Explorer > Right-click project (not solution) > Properties > Configuration Properties > General > Target API Level

Related

Could not find android.jar for API Level 26 in Visual Studio 2017

Could not find android.jar for API Level 26. This means the Android
SDK platform for API Level 26 is not installed. Either install it in
the Android SDK Manager (Tools > Open Android SDK Manager...), or
change your Xamarin.Android project to target an API version that is
installed. (C:\Program Files
(x86)\Android\android-sdk\platforms\android-O\android.jar missing.)
As you can see from below that I have the correct api sdk platforms installed but as you will notice on the error message, it is searching for an android-O directory.
Here is my directory which you will notice has everything in it but doesn't contain android-O
I looked in my visual studio project settings and here is what it shows for target framework
Does this mean that Visual Studio 2017 doesn't support Android SDK 26+?
I discovered that you can fix this issue with 2 steps:
Download and install Visual Studio 2017 Preview by going to https://www.visualstudio.com/vs/preview/
Download and install the Xamarin update extension on both versions of Visual Studio 2017 installed by going to https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/ and follow the steps
If you're building for a Xamarin project, you may need to rename the folder in the SDK folder from "android-{alphabetOSVersion}" to "android-{numericOSVersion}" (IE change the folder "android-o" to "android-27").
This should be done in the C:\Program Files (x86)\Android\android-sdk\platforms folder.
I was getting a similar issue.
Severity Code Description Project File Line Suppression State
Error Could not find android.jar for API level 29. This means the
Android SDK platform for API level 29 is not installed. Either install
it in the Android SDK Manager (Tools > Android > Android SDK
Manager...), or change the Xamarin.Android project to target an API
version that is installed. (C:\Program Files
(x86)\Android\android-sdk\platforms\android-29\android.jar missing.)
The easy fix was to follow the steps mentioned in the error itself from your Visual Studio (I was using Visual Studio 2019).
Click on the Apply Changes button and then reload the project.
MVS 2017 does support Android SDK 26+,
Im using it with v15.3.3.
If you have MVS 2017 installed on your machine,make sure it's up to date
then download and install the Xamarin update extension.
Check out this guide
https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/
And as a rule of thumb,whenever you get the error "Resolve the “Could not find android.jar for API Level XX” in Xamarin Studio" this are steps to follow to solve such an error
This happens when you target your project to a non-installed Android SDK platform, to fix this you have to install the right components.
Step 1:Target another Android Framework
On the project you have created right-click the project > Options
Go to the Xamarin project configurations
Then go to Build > General > Target framework, and select other Android target framework.
Xamarin project Android target framework
Step 2:Install the Android SDK you need
As the second option you can install the missing components needed to debug on the SDK Android platform; for this you have to go to:
Tools > Open Android SDK Manager
Android SDK Manager Option
Then look at the API Level number on the error or look at the version of the target framework as stated at the previous steps; then select to install the “SDK Platform” and press the “Install 1 package” button.
Choose the right Android SDK Platform
Accept license agreements
license agreements
With this you are ready, press F5 and you can debug now.

IBM Mobile first 7.0 build all environment Failed Running Android Studio:

My IBM MobileFirst v 7.0 project is not able to build an Android application. I'm getting the message below.
[2015-04-22 17:32:15] FWLST1125W: Android build will fail because an Android SDK was not installed. Use the Android SDK Manager to install API level 21, configure
your project to build with API level 21 by updating the Project Build Target in Project / Properties / Android dialog.
[2015-04-22 17:32:22] Failed Running Android Studio: Specify location of Android Studio in Window->Preferences->MobileFirst
And I have given the right path of Android Studio.
In MobileFirst Platform you have two development paths for Android applications:
Use Google's ADT tools; this will enable MobileFirst Studio to generate an Android project for the Hybrid application
If you do not have the ADT Eclipse plug-in installed you will receive this warning:
FWLST1125W: Android build will fail because an Android SDK was not
installed. Use the Android SDK Manager to install API level 21,
configure your project to build with API level 21 by updating the
Project Build Target in Project / Properties / Android dialog.
Use Android Studio; even if you have Android Studio set-up, you will still get the above warning in MobileFirst Studio - we're aware of this and have a ticket open about it. In this case, you can disregard the warning.
To use Android Studio from MobileFirst Studio, go to Eclipse > Preferences... > MobileFirst and set the path to the folder that contains Android Studio. For example, in Mac that would be /Applications.

unable to build Android project using Facebook SDK against Android 2.2 (Froyo)

I've recently started getting into programming with the Facebook SDK for Android, which I used to write a basic sample app. I want it to be able to run on as many systems as possible, so I set the build target to Android 2.2 (Froyo/API level 8). However, this results in the following error:
Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 8 FacebookTestApp
In comparison, all of the sample apps that came with the Facebook SDK have their build target set to Android 2.2, and none of them have this problem. Anyone know what I might be doing wrong?
Thanks.
I had the same problem today, this is how I fixed it:
Righ click on your project > properties > Java compiler > enable "project specific settings"
Set Compiler compliance level to 1.6
re Build your project
Voila!
Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 8
Here is the solution:
Right click your project -> Properties -> Android -> Select the lasted Project Build Target
This is what worked for me.
Right click on your project > Android Tools > Fix Project Properties.
Refresh the project and clean+build it.
Project -> Clean... -> Clean all projects
Fixed this for me.
You can build with API level 19 and still define minimum API level to 8.

IntelliJ 12.1.4 with Android Platform 4.2.2 on OSX compile error: Android SDK is parsed incorrectly

I have spent some time doing iOS development, but I am new to Android development. I use IntelliJ as my go to IDE for Java projects and really wanted to use it for my dive into Android development. Steps so far:
Installed Android SDK and downloaded the 4.2.2 platform and tools.
Created new project in IntelliJ selecting the Android Application module type.
Pointed the module settings to use the 4.2.2 Android SDK and Java 1.6.
Attempted to run the default run configuration built by IntelliJ.
I get the following compile error:
Information: Compilation completed with 2 errors and 0 warnings in 1 sec
Information: 2 errors
Information: 0 warnings
Error: Android Source Generator: Android SDK is parsed incorrectly. Parsing log:
Error parsing the sdk.
Error: Android Source Generator: [untitled2] Android SDK is invalid or not specified
I have not run into this yet, but in the Module Settings dialog I would check the following:
Project: Project SDK
Modules: for all modules: Module SDK. It's usually set to "Project SDK".
I also set the environment variable ANDROID_HOME.
If it still fails, I'd like to point you to I can't get IntelliJ to recognise my Android SDK.

Target 'Android 1.5' does not support building project with libraries

I'm trying to build a project in Android 1.5 that references another Android (library) project compiled against Android 1.5 and I keep seeing this error in the Console in Eclipse:
Target 'Android 1.5' does not support building project with libraries.
I'm running Eclipse 3.5, and version 0.9.7 of the ADT.
I followed the instructions here:
http://developer.android.com/guide/developing/eclipse-adt.html
What gives?
The problem was that I was using the wrong revision of Android 1.5. Table 1 on this page:
http://developer.android.com/guide/developing/eclipse-adt.html
states that you must be using revision 4 or later of Android 1.5 to use Library projects.

Categories

Resources