For a customer, I have to migrate an old Android Eclipse project which uses GoogleMaps V1 into Android Studio so changes can be made and a new APK can be compiled. There is still an older APK of this app which was compiled many years ago and after installing it I can safely confirm that it still works with all that old stuff and GoogleMaps V1.
After creating a new project (and modules) in Android Studio and copying over all the packages from the Eclipse project (this is my preferred way for migrating E projects to AS) AS is able to resolve everything but the packages from the GoogleMaps V1 API resulting in the error:
error: package com.google.android.maps does not exist
I tried everything and followed all the instructions on the web here on SO but nothing helped me.
some more background info:
I actually managed this migration like 1 or 2 years ago, but unfortunately, I don't have access to any the files anymore, so I have no clue how I achieved that and now I have to start over again. Nevertheless, because of this, I assume that technically it should still be able to have a working AS project with GoogleMapsV1. By the way, the reason why I need V1 is that we only own a GoogleMapsV1 API.
project build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 15
defaultConfig {
applicationId "some.id"
minSdkVersion 9
targetSdkVersion 15
versionCode 7
versionName "0.9.28.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
signingConfigs {
debug {
storeFile file("/debug.keystore")
}
release {
storeFile file("/keystore")
}
}
buildToolsVersion '23.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile project(':somelib')
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
}
Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="some.package"
android:versionCode="6"
android:versionName="1.2.3.0"
android:installLocation="auto">
<uses-sdk android:targetSdkVersion="9"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<uses-library android:name="com.google.android.maps" />
<!--
<uses-library android:name="some.lib" />
-->
<activity android:name="some.activity"
android:label="@string/app_name" android:icon="@drawable/icon" android:multiprocess="false" android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:enabled="true" android:name="some.service"
android:permission="android.permission.ACCESS_FINE_LOCATION"
android:icon="@drawable/icon"></service>
</application>
</manifest>