Android Google Maps ClassNotFoundException - android

I'm creating my first Google Maps app, but I've run into some trouble and I can't figure out why. I'm getting a ClassNotFoundException. I'm new to Android in general, but this error has me stumped.
Here's my manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.purdue.cs.cs180.safewalk"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".RequestActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
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>
</manifest>
And here's how my layout uses the MapView. I know that my API key is correct.
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="#string/mapskey" />
Finally, here's the error from the logcat.
12-03 13:11:25.861: E/AndroidRuntime(940): Caused by: java.lang.ClassNotFoundException: Didn't find class "edu.purdue.cs.cs180.safewalk.RequestActivity" on path: /system/framework/com.google.android.maps.jar:/data/app/edu.purdue.cs.cs180.safewalk-2.apk
Edit: Sorry, the manifest didn't copy over perfectly. Yes, the package has been set. And my virtual device is set with Target: Google APIs (Google Inc.) - API Level 17.

If you are trying to run it in the emulator, you need to define you AVD with Target set to Google APIs (Google Inc) - ... and not Android nn - ....
Regards.

Only close the project and reopen it. Fix it.
Orz

Related

MAPS API - application not running on the emulator

I'm verry new at android developement , i'm trying to make a map application but can't even show a simple map on a fragment .
I've followed many & many tutorials , search a lot of answers in stackoverflow but still can't get the result i want .
I'm developping in eclipse and running app in emulator , i created a list of emulators to test on them but no one could show me the Map fragment.
The current AVDs that i have now are:
NEXUS S with ARMEABI V7 image system API 22
NEXUS S with Google API's intel Atom 86 API 22
Google NEXUS S with Google API's ARM API 22
All theese 3 don't have google play services and can't even install it on them (the tutorials i've watched not worked).
The last AVD that i could install Google play services in is the NEXUS S with ARM v7 image system API 17, i've google play services 12-5-18-000300-188802357 working fine and i've installed googleFrameWork and google play store(keep crashing even when update it )
The continious message i'm getting in this later is "Google play services are updating" ,everytime i try update the google play services , the app crash and stopped immediately .
This is my Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.algerlasmart"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="com.exemple.algerlasmart.permission.MAPS_RECEIVE"
android:protectionLevel="signature">
</permission>
<uses-permission android:name="android.permission.ACESS_NETWOK_STATE"/>
<uses-permission
android:name="com.exemple.algerlasmart.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="27" />
<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"
android:name="android.support.multidex.MultiDexApplication"
>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBBu2eJ-fSdlwUI9dPJhlbxK0emspboplQ"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainInterface"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
</activity>
<activity
android:name=".GetContact"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
</activity>
<activity
android:name="com.exemple.fragments.Dummy"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
<intent-filter >
<action android:name="com.exemple.fragments.Dummy"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
The Google play services library i've used is lib for API 22 (not worked) and i downgrade to lib r18 (old from google's repôsitories).
the XML file of my map is the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/arroundMeLay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/libele"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<fragment
style="#style/mapViewStyle"
android:layout_width="match_parent"
android:layout_height="200dp"
class="com.google.android.gms.maps.MapFragment" >
</fragment>
</LinearLayout>
Please i've spend over a month stucking at these problems .
NOTE : i've tried every time to update ,upgrade , downgrade SDK but still no answer or solution worked for me .

Android Google Maps API application crashing on startup

I am new to Android programming. I learnt the very basics of an Activity and Activity Life cycle, and am willing to learn the Google Maps API.
However, I am unable to configure and run an application.I went through the Google documentation on installing the API and did as they said.I even used their code to check if the API was running.But every time I run, my application crashes.I don't know anything about debugging, and logcat shows me a few errors.
Can someone please explain the log to me and also help me get the program running ?I would be really thankful for your help.
Here is what logcat shows me(I use Eclipse IDE) :
My manifest code:
'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.geo_tagger"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<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.example.geo_tagger.MainActivity"
android:label="#string/app_name" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<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="AIzaSyA4mPKlxJuy_Wfh-izUee2oY5kokQhB9Z0"/>
</application>
</manifest>' $

Unable to instantiate application - AndroidManifest settings

We have recently developed an Android app and published it via Google Play. First of all we created a beta test group, added members to it and got feedback etc from each and everyone of them. We had no problems publishing and installing this beta version on the users devices.
We promoted this beta version (API level 14+) to production and suddenly the app started to fail after installing with the following error:
java.lang.RuntimeException: Unable to instantiate application x.x.x.App:
java.lang.ClassNotFoundException: x.x.x.App
In the AndroidManifest file the name attribute of Application was the full packagename x.x.x.App. We changed this to be just the class name App and everything started to work smoothly.
However the customer decided to make the app compatible with API 10 - 13 and we made the changes to AndroidManifest file accordingly. We just changed the minSDK=10. Again we had the beta testing process with no further errors etc.
We then decided to promote this app to production and now we get the same error
java.lang.RuntimeException: Unable to instantiate application x.x.x.App:
java.lang.ClassNotFoundException: x.x.x.App
again when installing/upgrading to this new version.
What on earth is going on here - I need an explanation (if it exists) since I am not able to find any meaning of this?
EDIT: The manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.expatindenmark.adquota"
android:versionCode="8"
android:versionName="3.2" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="App"
android:allowBackup="false"
android:icon="#drawable/ic_launcher_hoejtid_ikon"
android:label="#string/app_name" >
<activity
android:name="com.expatindenmark.adquota.SplashActivity"
android:configChanges="locale"
android:label="#string/app_name"
android:screenOrientation="portrait"
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>
<activity
android:name="com.expatindenmark.adquota.AdquotaTabActivity"
android:configChanges="locale"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
</application>
</manifest>
As stated in an earlier comment I changed name = "App" to name = ".App" and that works.

Application is suddently not compatible with tablets on Google Play

my application was "visible" on Google play. I did not make any changes (I did not upload new apk) and application is suddently not compatible with tablets. Thanks for any help.
Look at very simple manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fly.is.fun.unlocker"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="7" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="fly.is.fun.unlocker.MainActivity"
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>
</manifest>
Please check whether it's not visible on any device or some specific devices.
I had the same problem. But that was specific to Tab2.
Because I was using CAMERA permissions and Tab2 doesn't have autofocus for camera.
So I added following line in AndroidManifest file and then uploaded new apk to market.
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
Now it's visible in Google play.
Also check Filters on Google Play
Hope this helps.
In developer console, you only can see small, normal, large. You may try to add android:targetSdkVersion with a value higher or equal to 11

Android error: Application is not installed on your phone

I am getting this error when trying to install my exported unsigned application on tablet pc (running Android 4.04. version). App is normally installing and running in Android emulator in Eclipse. I tried removing and reinstalling it, but that didn't help either. Atached is my AndroidManifest.xml since problem is often there (but I can't see any duplicate code).
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hr.punctum.LociranjePonudaProizvoda"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="16" />
<application
android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:label="#string/app_name"
android:name=".ListaProizvoda" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="DetaljiProizvoda"></activity>
<activity android:name="GMapsActivity"></activity>
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
The only thing suspicious I see is the uses-library tag, do you have the Google Maps lib in your tablet? (if yes then you should have the following files in it)
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar
Without the lib the apk installation will fail with INSTALL_FAILED_MISSING_SHARED_LIBRARY error.

Categories

Resources