I have a project that I'm trying to run but I want to run it against Google API's 21 so that I can use MapActivity and basically implement this maps solution
I added the code and to get it working without errors I had to add compileSdkVersion to "Google Inc.:Google APIs:21".
Every time I launch, the app crashes on launch with this exception:
Suppressed: java.lang.ClassNotFoundException: com.syncworks.syncmap.Main
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I cannot seem to solve it. I've tried cleaning the project, rebuilding. Changing the compileSdkVersion to 21 prevents me from using the classes in the linked solution. I have Google API's installed from the SDK manager and the Google Play Services library is working cause I was able to launch the app fine just before trying to implement the linked solution.
I read answers about checking whether Android Private Libraries were included but I didn't know how I could access and check that from Android Studio
below is my app's build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion "Google Inc.:Google APIs:21"
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.syncworks.syncmap"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
And here's my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.syncworks.syncmap" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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-library android:name="com.google.android.maps"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".Main"
android:label="@string/title_activity_maps" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any help please?