Select to view content in your preferred language

Hello World / New Install

6662
14
12-29-2011 11:26 AM
JayKappy
Frequent Contributor
I am trying to install and get a hello world app going...
I wen tthrough the Install instructions which were very confusing, install this before this but after this, but not untill you install this....I have no idea if I installed things right...anyways...

I open Eclipse and go:
File>New>Project
Choose ArcGIS project for Andoid
Give it a project name
Give it a package name (dont really understand this one) I called it "com.esri.andoid.sample"

I keep getting this error in the Console

[2011-12-29 15:11:02 - HelloWorldMap] Unable to resolve target 'android-8'

In the Package Explorer HelloWorldMap, src, com.esri.android.sample, HelloWorldMapActivity.java all have a little red square box next to them with a white X

There are 4 errors in the Problems tab

1. The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
2. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
3. Unable to resolve target 'android-8' HelloWorldMap
4. Unable to resolve target 'android-8' until the SDK is loaded.

Any thoughts? Please help...very confused here....

THanks
0 Kudos
14 Replies
JayKappy
Frequent Contributor
I am confused here....
I right clicked the HelloWorldMap in the Navigator (in eclipse) adn hit properties adn then the Android option in the TOC....I saw API Level was 15
So I manually changed the project.properties target to Target=android-15

Now from yoru example I went into the HelloWorldMap Manifest and saw that it too was referencing android-8...I changed this to Android-15 "<uses-sdk android:minSdkVersion="15" />"

Is my phone out of date? To old of an API? am I readign all fo this correctly and correct to change the settings to 15 instead of 8...I i leave the prpoject.properties at 8 I get an error : unable to resolve android-8

NOW Getting this error:
[2012-01-03 11:15:44 - HellWorldMap] ERROR: Application requires API version 15. Device API version is 8 (Android 2.2).
[2012-01-03 11:15:44 - HellWorldMap] Launch canceled!

HOW DO I KNOW WHAT I SHOUDL BE SETTING THIS AS 8 or 15

I am also gettign errors below on this line: <uses-permission android:name="android.permission.INTERNET" />
Error: <uses-permission> tag appears after a <application> tag

you talking here

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.esri.android.sample"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<uses-feature android:glEsVersion="0x00020000" android:required="true"/>

<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:debuggable="true">
<activity android:name=".HellWorldMapActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
0 Kudos
SwatiGadey
Emerging Contributor
This means that your device has an API level 8.

For this, you need to have API set to 8 in Manifest file, i.e. android:minSdkVersion="8" (which you already have). Also, set the same in the Project Properties => Android tab => Project Build Target - Select Android 2.2 (API Level 😎 instead of API Level 15.

This will do the needful in the project.properties file, which is generated automatically upon building the project. You should not alter this file.

Hope this resolves your issue.
0 Kudos
JayKappy
Frequent Contributor
WAIT ONE SECOND...THINK I GOT IT.....

Wonders what simply clicking buttons and settings will do....although remembering what you did is the trick....
0 Kudos
AdrianJaimes
New Contributor
It was difficult to tell if you successfully installed the appropriate Android SDK platforms, e.g. 2.2, from your screenshot but I suspect it was not installed when you were experiencing the issues. The fact that you had to select Android 4.0.3 as your project build target and change the target to API level 15 to resolve the issue also implies that you don't have the appropriate Android SDK platforms installed.  

You reference that the install instructions were very confusing, which install instructions are you referring to? Are you referring to the ArcGIS instructions or our prerequisite for installing the Android SDK docs which we link to? We really want to ensure the install steps as simple as possible. Currently we do not step you through the Android SDK or ADT install instructions and presume you have this set up before installing the ArcGIS SDK.   We have created a blog post which steps readers through the entire process. Please let us know if this helps or if you are continuing to have issues. 

You also referenced not understanding the package name. The ArcGIS Runtime for SDK for Android includes a Java API so all source is written in Java. A Java package is a way to organize Java classes into namespaces. This feature make types easier to find and use types and avoids class naming conflicts. Please refer to the   Java Package tutorial for reference.


I followed the instructions and my problem has been resolved. Thank's for support, I really apreciate keep on contact
0 Kudos
TimWilliams
Deactivated User
I had the "Unable to resolve target" error along with other random errors.
I fixed it by making the target match the installed platform.
In windows explorer I went to the SDK/platforms directory.  In it was a folder named android-19.  This indicated I had the android-19 platform installed. I then edited AndroidManifest.xml and project.properties to set the target to android-19.
All errors went away.
0 Kudos