function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
King KooKing Koo 

Over 100 errors when trying to new android project (using SF SDK/native/templateApp)

Hi guys

 

Hope someone can help me here.  I read from a few places the steps I have carried out are not wrong but I somehow got a list of over 100 error messages when I'm trying to:

 

File -> New -> Project -> Android -> Android Project from Existing Code

and root directory in the "Import Projects" was set to

C:\King\Salesforce\SalesforceMobileSDK-Android\native\TemplateApp

 

and I checked the "Copy projects into workspace".

 

The following is  a list of some errors I got.  I thought I have followed this page:

http://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_Android

 

but I just couldn't escape the errors.  What have I done wrong?  This is a list of all my configurations:

Java SDK7u9

Android SDK r20.0.3

Salesforce Mobile SDK for Android (I used GitHub to clone, and which I cscript install.vbs afterwards)

Eclipse 3.6.2

and I also installed the ADT Plugin,

and I also used Android SDK Manager to include API8 and API11.

 

Anyone have any ideas?  Many many thanks.

 

 

Description Resource Path Location Type
AsyncRequestCallback cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 174 Java Problem
ClientManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 100 Java Problem
ClientManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 100 Java Problem
Encryptor cannot be resolved TemplateApp.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 50 Java Problem
error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 8 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'resource' with value '@xml/authenticator'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 19 Android AAPT Problem
EventsObservable cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
EventsObservable cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 115 Java Problem
EventType cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
EventType cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 115 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 91 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 94 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 104 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 139 Java Problem
ForceApp cannot be resolved MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 191 Java Problem
ForceApp cannot be resolved to a type TemplateApp.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 39 Java Problem
LoginOptions cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 92 Java Problem
LoginOptions cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 92 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 58 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 88 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 123 Java Problem
PasscodeManager cannot be resolved to a type MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 128 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 70 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 81 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 85 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 95 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 96 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 112 Java Problem
R cannot be resolved to a variable MainActivity.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 172 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 38 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 39 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 40 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 41 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 42 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 43 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 44 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 45 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 46 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 47 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 48 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 49 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 50 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 51 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 52 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 53 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 55 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 56 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 57 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 58 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 59 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 60 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 61 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 62 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 63 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 64 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 65 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 66 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 67 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 68 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 69 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 71 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 72 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 73 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 74 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 75 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 76 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 77 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 78 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 79 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 80 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 81 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 82 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 83 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 84 Java Problem
R cannot be resolved to a variable SalesforceRImpl.java /com.salesforce.samples.templateapp.MainActivity/src/com/salesforce/samples/templateapp line 85 Java Problem

augiewazaugiewaz

Kingkoo,

 

Check the list of Android dependencies and check that the SalesforceSDK library is listed..

 

You need to have this library added to your Project otherwise you will get these kind of errors.

 

What you can also try (not sure if its related here) but I imported the hybrid ContactExplorer project and that also gave me errors.

To correct this, I modified the last line of the project.properties file from:

android.library.reference.1=../../../native/SalesforceSDK

 

TO 

android.library.reference.1=../SalesforceSDK

 

Hope it helps.

Warren

 

 

 

 

King KooKing Koo

Hi Warren

 

Very interesting, I definitely want to try that out.  Can you let me know how to "add" SalesforceSDK within Eclipse?  Do I add it to Eclipse or do I add it to the project?

 

If I understand what you mean, this is some standard Salesforce SDK (not Android SDK, but Salesforce's) that I have omitted to add, and that would make sense.  If you could let me know how to add that I'll definitely give it a try and see if any differences are made.

 

Thanks a lot.

King

augiewazaugiewaz

King,

 

You add it to the project.

 

Right click on the Project, select Properties and the you have the Libraries section.

You then select Add External Jar and you need to select the SalesforceSDK.

 

You can find this jar file in the SalesforceSDK project that you get from GIT.

 

Hope this helps.

Warren

King KooKing Koo

H Warren

 

Thanks again for your reply.  I can sense I'm getting very close, just not quite yet.

 

I went to right click the project, Properties, and I believe you meant "Java Build Path" from the left panel, then click the "Libraries" tab and then click the "Add External JARs" button correct?

 

The problem is, once I get the winow to select eh JAR, I don't know what JARs to add.  Is it just one JAR or are there a lot to add?  Can you be more specific please?  Thanks.  (I did a search in my SalesforceMobileSDK-Android and there are 36 JARs so I don't know which one(s) to add).

 

Thanks

King

augiewazaugiewaz

King,

 

Your on the right track.

 

You can use either SalesforceSDK.jar or SalesforceSDK-1.3.1.jar

Could be wrong but I believe they are same file. The latest version of the SDK. You can find it in the dist folder 

 

Warren

King KooKing Koo

Hi Warren

 

Thanks again for the reply.  Big improvement, but not out of the woods yet.....  Hope this is the last!!  Haha.......

 

I'm down to 58 errors, but 56 of them are the same.  Even after I try to "clean" the project, I still have these errors

 

They are:

1.

error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 8 Android AAPT Problem

 

2.

error: Error: No resource found that matches the given name (at 'resource' with value '@xml/authenticator'). AndroidManifest.xml /com.salesforce.samples.templateapp.MainActivity line 19 Android AAPT Problem

 

3 - 58:

R cannot be resolved to a variable MainActivity.java  or SalesforceRImpl.java over various lines

 

Any pointers?  Thanks again Warren, I really appreciate it that you've been hand holding me on this one.

 

King

augiewazaugiewaz

Did you try this?

 

What you can also try (not sure if its related here) but I imported the hybrid ContactExplorer project and that also gave me errors.

To correct this, I modified the last line of the project.properties file from:

android.library.reference.1=../../../native/SalesforceSDK

 

TO 

android.library.reference.1=../SalesforceSDK

King KooKing Koo

Hi Warren

 

Wow really feeling defeated......

 

So first of all, the content of my project.properties looks fine already.  Besides the comment lines, this is the content:

 

target=android-8
android.library.reference.1=../SalesforceSDK

 

What I did was I downloaded a small png and saved it as res\drawable\sf__icon.png.  That removed the error 

No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon')

 

And then I created a authenticator.xml file under res\xml, the content of which is:

<account-authenticator
android:accountType="com.salesforce.samples.templateapp" android:icon="@drawable/sf__icon" android:label="@string/app_name" xmlns:android="http://schemas.android.com/apk/res/android">
</account-authenticator>

and that removed the error

No resource found that matches the given name (at 'resource' with value '@xml/authenticator')

 

And I no longer have "R cannot be resolved to a variable" errors.  However, I got a whole bunch of new errors, all originating from SalesforceRImpl.java.  They are:

menu cannot be resolved or is not a field
sf__apply_button cannot be resolved or is not a field
sf__auth_container cannot be resolved or is not a field
sf__auth_login_production cannot be resolved or is not a field
sf__auth_login_sandbox cannot be resolved or is not a field
sf__cancel_button cannot be resolved or is not a field
sf__custom_server_url cannot be resolved or is not a field
sf__edit_icon cannot be resolved or is not a field
sf__generic_authentication_error cannot be resolved or is not a field
sf__generic_authentication_error_title cannot be resolved or is not a field
sf__generic_error cannot be resolved or is not a field
sf__invalid_server_url cannot be resolved or is not a field
sf__load_separator cannot be resolved or is not a field
sf__load_spinner cannot be resolved or is not a field
sf__login cannot be resolved or is not a field
sf__menu_clear_cookies cannot be resolved or is not a field
sf__menu_clear_custom_url cannot be resolved or is not a field
sf__menu_pick_server cannot be resolved or is not a field
sf__menu_reload cannot be resolved or is not a field
sf__oauth_webview cannot be resolved or is not a field
sf__passcode cannot be resolved or is not a field
sf__passcode_confirm_instructions cannot be resolved or is not a field
sf__passcode_confirm_title cannot be resolved or is not a field
sf__passcode_create_instructions cannot be resolved or is not a field
sf__passcode_create_title cannot be resolved or is not a field
sf__passcode_enter_instructions cannot be resolved or is not a field
sf__passcode_enter_title cannot be resolved or is not a field
sf__passcode_error cannot be resolved or is not a field
sf__passcode_final cannot be resolved or is not a field
sf__passcode_instructions cannot be resolved or is not a field
sf__passcode_min_length cannot be resolved or is not a field
sf__passcode_text cannot be resolved or is not a field
sf__passcode_title cannot be resolved or is not a field
sf__passcode_try_again cannot be resolved or is not a field
sf__passcodes_dont_match cannot be resolved or is not a field
sf__picker_custom_label cannot be resolved or is not a field
sf__picker_custom_url cannot be resolved or is not a field
sf__server_list_group cannot be resolved or is not a field
sf__server_name cannot be resolved or is not a field
sf__server_picker cannot be resolved or is not a field
sf__server_url_add_title cannot be resolved or is not a field
sf__server_url_default_custom_label cannot be resolved or is not a field
sf__server_url_default_custom_url cannot be resolved or is not a field
sf__server_url_edit_title cannot be resolved or is not a field
sf__show_custom_url_edit cannot be resolved or is not a field
style cannot be resolved or is not a field

 

It looks like this TemplateApp project Salesforce gave is not a complete project with missing resource files.. .  I wonder why that is.......

 

Thank you again a lot.

King

 

 

AGessnerAGessner

Hi King,

Did you solve these last problems with SalesforceRImpl.java?

I have the same problems.

 

Thanks.

 

NagatoNagato

Hi kingkoo,

 

Right click on the Project, select Properties and the you have the Android section.

 

Is not the reference of the SalesforceSDK  wrong?