I've switched from Windows to Ubuntu this week.
I have imported my Android project into Eclipse, and it shows no errors, the project can be built normally.
However, when I try to run the application on a device, the app crashes with the following messages:
04-25 14:14:15.700: E/dalvikvm(12640): Could not find class
'com.google.ads.AdRequest', referenced from method
com.myApp.initAds
and
04-25 14:14:15.790: E/AndroidRuntime(12640): Caused by:
java.lang.ClassNotFoundException: com.google.ads.AdView in loader
dalvik.system.PathClassLoader[/data/app/com.busybits.treinverkeer-2.apk]
04-25 14:14:15.790: E/AndroidRuntime(12640): at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-25 14:14:15.790: E/AndroidRuntime(12640): at
java.lang.ClassLoader.loadClass(ClassLoader.java:551) 04-25
14:14:15.790: E/AndroidRuntime(12640): at
java.lang.ClassLoader.loadClass(ClassLoader.java:511) 04-25
14:14:15.790: E/AndroidRuntime(12640): at
android.view.LayoutInflater.createView(LayoutInflater.java:471) 04-25
14:14:15.790: E/AndroidRuntime(12640): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
04-25 14:14:15.790: E/AndroidRuntime(12640): ... 22 more
My build-path is as follows:
FlurryAgent.jar
GoogleAdmobAdsSdk-4.1.0.jar
Android 2.2
How can I fix this?
Did you installed Android SDK 18 or later? If so, check where is your jar files. They should be in project_home/libs folder.
Related
I got this crash report from many users.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.*appname*/com.unity3d.player.UnityPlayerActivity}: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayerActivity" on path: /mnt/asec/com.*appname*-1/pkg.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
at android.app.ActivityThread.access$700(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayerActivity" on path: /mnt/asec/com.*appname*-1/pkg.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2220)
... 11 more
Anyone have any idea what to do?
Never used unity3d... also I don't know what's in your gradle files, so can't really say unless you give more information. However, you could try cleaning your project and rebuilding it. Go to Build -> Clean Project or use gradlew clean if you are comfortable with the command line.
I updated an app in goolge play store with a new version.Now if app open then Application class not found exception occurs.
App works fine if the apk install directly .But not from play store.
Crash analytics report says
java.lang.RuntimeException: Unable to instantiate application com.xxx.xx.GetJsonArrayFromChannelUrl: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.GetJsonArrayFromChannelUrl" on path: /data/app/com.xx.xx-2.apk
at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4584)
at android.app.ActivityThread.access$1400(ActivityThread.java:158)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5365)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxxx.fetchdata.GetJsonArrayFromChannelUrl" on path: /data/app/com.xx.xx-2.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newApplication(Instrumentation.java:985)
at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
Follow these steps.
Clean your libraries
Right click on project > Android Tools > Fix Project properties
Project > Clean
I am getting class not found exception on some android devices, it's happening only on some devices.
This is the call-stack i have got,
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.picframes.android/com.picframes.android.first}: java.lang.ClassNotFoundException: com.picframes.android.first
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
at android.app.ActivityThread.access$600(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1262)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.picframes.android.first
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
Any suggestions for resolving this problem, I could not reproduce this problem on my device.
On devices with which android version program works and where it doesn't work? I am not sure if this is the case but you probably get this error on older devices, is that right? You should make sure that all the functionality of your program is available on older systems. Use your manifest file:
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
to define minimum sdk version, and you will get errors in your code if you are trying to use features that are not available on the device that you target.
Installing Apache Tomcat, Apache Axis2, Create web project, Convert to service, Deploy it in Tomcat, Create client project then, Create client with stub of our services and finally, access the service.
I think these are all the steps to consume web service on Android Eclipse.
Here I have completed up to the step deploying the web project on tomcat server, it shown about the services successfully, but server option shown up as SYNCHRONIZED. It's given below
server
Tomcat v6.0 server at localhost[Started,Synchronized]
AndBack[Synchronized].
Meanwhile after creating client project it shown up during run time as:
Sorry! The application has stopped unexpectedly. Please try again. Force close
Please refer my logcat given below.
LOGCAT
04-25 16:46:51.153: E/dalvikvm(273): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method org.test.Frontend.AndFrontActivity.onCreate
04-25 16:46:51.153: W/dalvikvm(273): VFY: unable to resolve new-instance 25 (Lorg/ksoap2/serialization/SoapObject;) in Lorg/test/Frontend/AndFrontActivity;
04-25 16:46:51.153: D/dalvikvm(273): VFY: replacing opcode 0x22 at 0x0010
04-25 16:46:51.164: D/dalvikvm(273): VFY: dead code 0x0012-0081 in Lorg/test/Frontend/AndFrontActivity;.onCreate (Landroid/os/Bundle;)V
04-25 16:46:51.243: D/AndroidRuntime(273): Shutting down VM
04-25 16:46:51.243: W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-25 16:46:51.273: E/AndroidRuntime(273): FATAL EXCEPTION: main
04-25 16:46:51.273: E/AndroidRuntime(273): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
04-25 16:46:51.273: E/AndroidRuntime(273): at org.test.Frontend.AndFrontActivity.onCreate(AndFrontActivity.java:28)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 16:46:51.273: E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)
Turns out external jars such as
ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar
to be put under /libs folder so Eclipse ADT automatically adds your jars to the buildpath of your application. It was a buildpath missing defined class error after all.. I hope this will help you, too!
here or there
I developed my app with minSdkVersion set to 3, targetSdkVersion set to 8.
My app is published, and runs on everything from Android 1.5 to 3.0 Though devices it will run on with anything older than 2.0 is always spotty, some it will and some it won't
It works perfect on my Incredible, Android 2.2. It uses 5-8mb memory when running.
However I decided I wanted to split it into two different apps, one for Android 1.5 and 1.6 compatibility and another with higher quality images optimized for tablets.
The only line I changed was setting minSdkVersion from 3 to 5, and all of a sudden it won't run on any phone or emulator?
Now on my Incredible, it uses 7mb just to show the menu background, and gives me an out of memory error every time when loading another image.
Any ideas? Thanks
04-25 17:19:45.476: ERROR/dalvikvm-heap(20145): 7094850-byte external allocation too large for this process.
04-25 17:19:45.476: ERROR/dalvikvm(20145): Out of memory: Heap Size=4871KB, Allocated=2517KB, Bitmap Size=19170KB
04-25 17:19:45.476: ERROR/GraphicsJNI(20145): VM won't let us allocate 7094850 bytes
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): FATAL EXCEPTION: main
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): java.lang.RuntimeException: Unable to resume activity {com.ht/com.ht.Garage}: android.view.InflateException: Binary XML file line #10: Error inflating class com.ht.Panel
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3347)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3362)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2808)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.access$2300(ActivityThread.java:135)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.os.Looper.loop(Looper.java:144)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.main(ActivityThread.java:4937)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Method.invoke(Method.java:521)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at dalvik.system.NativeStart.main(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.ht.Panel
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Activity.setContentView(Activity.java:1654)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.ht.Garage.onResume(Garage.java:165)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1255)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Activity.performResume(Activity.java:3864)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3337)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 12 more
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: java.lang.reflect.InvocationTargetException
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.ht.Panel.<init>(Panel.java:107)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Constructor.constructNative(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 23 more
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.graphics.Bitmap.nativeCreate(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.graphics.Bitmap.createBitmap(Bitmap.java:574)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 27 more
04-25 17:19:48.066: ERROR/ActivityManager(97): fail to set top app changed!
Set your minSdkVersion to API level 7, API level 5 and 6 are no longer available as 2.0 has been completely phased out. The Android SDK manager does not offer those API's any longer as an available package because they have been marked as obsolete. I just did a new install on a new system and found the API's unavailable.
I found how to fix it, setting anyDensity to false works. I don't understand why it works though.
With API 3, anyDensity has a default value of false, but I was setting it to true!
With an API of 4 (or is it 5) or higher, anyDensity has a default value of true.
How is it any different between it defaulting to true with API 7, and me setting it to true with API 3?
That should not affect memory usage at all, it ends up being the same value no matter what!
Oh well, my app hasn't needed anyDensity set to true since I put in code to dynamically scale the images based on screen size and density anyway.