Andrew Martin
Andrew Martin

Reputation: 5741

Can't load Android project in Eclipse

Real beginner's question: My university group are working on an Android project. We're hosting it on an repository. I tried to download a version but I can't get it working.

I have Eclipse 32Bit installed, with the latest version of the JDK. I have the Android SDK Manager installed, with Android SDK Tools, Android SDK Platform-Tools, Android 4.2.2(API 17), Android 4.1.2(API 16) and all the extras installed.

To begin with, I was getting an error "Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties." I did this but it didn't fix anything. I found an alternative fix on Google which suggested I right click the project and go to properties. Then, go to Java Compiler, choose Enable Project Specific Settings and choose a lower compliance level. I did this and set it to 1.6.

I've read that something could be missed from the Android Manifest but I honestly don't know what. This is a copy of it:

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

<uses-sdk
    android:minSdkVersion="12"
    android:targetSdkVersion="16" />

<permission
    android:name="com.csc7045project.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>

<uses-permission android:name="com.csc7045project.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.csc7045project.EventActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyCvdEysH-5FQeiNDiiXFBd25iZLtZYIdUY"/>

</application>

</manifest>

In the main code of the project, the issue all seems to resolve around GoogleMaps. There is a variable GoogleMap map, and all references to the variable map in the code are errors. I do have the Google APIs downloaded through the SDK Manager.

I'd appreciate any advice on how to fix it so I can start to contribute. Additionally, I should point out at this stage that the project does work on other machines, so it's not an error with the code.

Edit: When I run, I get the following 18 errors (some of these errors are repeated multiple times):

CameraUpdateFactory cannot be resolved
CameraUpdateFactory cannot be resolved
GoogleMap cannot be resolved to a type
LatLng cannot be resolved to a type
MapFragment cannot be resolved to a type
Marker cannot be resolved to a type
MarkerOptions cannot be resolved to a type
OnMarkerClickListener cannot be resolved to a type

Edit 2:

Edit 2: Screenshot of Project Folder added

Upvotes: 0

Views: 1104

Answers (1)

Emil Adz
Emil Adz

Reputation: 41099

From the errors you receive it seems like you handled you first problem:

Android requires compiler compliance level 5.0 or 6.0. Found '1.7'

now you problem is derived from the fact that classes that are related to Google Map API V2 can't be found by the compiler. this problem will occur when you don't perform the Google Map API V2 referencing correctly.

please head to this guide I wrote on how to properly integrate Google Maps in your application and follow the first three steps to get an idea of how it's done correctly:

Google Maps API V2

Upvotes: 1

Related Questions