Can't run FacePreview on android device - android

When you attempt to run the sample javacv 1.1 FacePreview (https://github.com/bytedeco/javacv/blob/master/samples/FacePreview.java) from eclipse error message:
12-22 21:54:10.439: E/AndroidRuntime(26606): FATAL EXCEPTION: main
12-22 21:54:10.439: E/AndroidRuntime(26606): Process: org.opencv.samples.facedetect, PID: 26606
12-22 21:54:10.439: E/AndroidRuntime(26606): java.lang.NoClassDefFoundError: Failed resolution of: Lorg/bytedeco/javacpp/Loader;
12-22 21:54:10.439: E/AndroidRuntime(26606): at org.opencv.samples.facedetect.FaceView.<init>(FdActivity.java:125)
12-22 21:54:10.439: E/AndroidRuntime(26606): at org.opencv.samples.facedetect.FdActivity.onCreate(FdActivity.java:98)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.Activity.performCreate(Activity.java:6021)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.ActivityThread.access$800(ActivityThread.java:155)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.os.Handler.dispatchMessage(Handler.java:102)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.os.Looper.loop(Looper.java:135)
12-22 21:54:10.439: E/AndroidRuntime(26606): at android.app.ActivityThread.main(ActivityThread.java:5376)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.reflect.Method.invoke(Native Method)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.reflect.Method.invoke(Method.java:372)
12-22 21:54:10.439: E/AndroidRuntime(26606): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
12-22 21:54:10.439: E/AndroidRuntime(26606): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
12-22 21:54:10.439: E/AndroidRuntime(26606): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.bytedeco.javacpp.Loader" on path: DexPathList[[zip file "/data/app/org.opencv.samples.facedetect-1/base.apk"],nativeLibraryDirectories=[/data/app/org.opencv.samples.facedetect-1/lib/arm, /vendor/lib, /system/lib]]
12-22 21:54:10.439: E/AndroidRuntime(26606): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
12-22 21:54:10.439: E/AndroidRuntime(26606): ... 15 more
12-22 21:54:10.439: E/AndroidRuntime(26606): Suppressed: java.lang.ClassNotFoundException: org.bytedeco.javacpp.Loader
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.Class.classForName(Native Method)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
12-22 21:54:10.439: E/AndroidRuntime(26606): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
12-22 21:54:10.439: E/AndroidRuntime(26606): ... 16 more
12-22 21:54:10.439: E/AndroidRuntime(26606): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I did everything according to instructions https://github.com/bytedeco/javacv
tell me what could be the problem?
sorry for my English.
Thank you in advance!

Related

java.lang.RuntimeException: An error occured while executing doInBackground() Kotlin

I was trying to access my MS Database Locally so i have this DatabaseHelper.kt file which i included the Doinbackground Function, which in turn brings out this error.
CodeSnippet
06-19 15:28:45.082 18819-18819/? E/Zygote: MountEmulatedStorage() 06-19 15:28:45.082 18819-18819/? E/Zygote: v2 06-19 15:28:45.092 18819-18819/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL 06-19 15:28:45.092 18819-18819/? E/art: setrlimit(RLIMIT_CORE) failed for pid 18819: Operation not permitted 06-19 15:28:47.814 18819-18819/com.example.mysqlcon E/RecyclerView: No adapter attached; skipping layout 06-19 15:28:47.924 18819-18819/com.example.mysqlcon E/RecyclerView: No adapter attached; skipping layout 06-19 15:28:47.984 18819-18862/com.example.mysqlcon E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.example.mysqlcon, PID: 18819 java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/ietf/jgss/GSSManager; at net.sourceforge.jtds.jdbc.TdsCore.createGssToken(TdsCore.java:4400) at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1971) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:617) at net.sourceforge.jtds.jdbc.JtdsConnection.(JtdsConnection.java:371) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) at java.sql.DriverManager.getConnection(DriverManager.java:179) at java.sql.DriverManager.getConnection(DriverManager.java:144) at com.example.mysqlcon.ConnectionClass.dbConn(ConnectionClass.kt:26) at com.example.mysqlcon.DatabaseHelper$SyncData.doInBackground(DatabaseHelper.kt:36) at com.example.mysqlcon.DatabaseHelper$SyncData.doInBackground(DatabaseHelper.kt:23) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.ietf.jgss.GSSManager" on path: DexPathList[[zip file "/data/app/com.example.mysqlcon-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at net.sourceforge.jtds.jdbc.TdsCore.createGssToken(TdsCore.java:4400) at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1971) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:617) at net.sourceforge.jtds.jdbc.JtdsConnection.(JtdsConnection.java:371) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) at java.sql.DriverManager.getConnection(DriverManager.java:179) at java.sql.DriverManager.getConnection(DriverManager.java:144) at com.example.mysqlcon.ConnectionClass.dbConn(ConnectionClass.kt:26) at com.example.mysqlcon.DatabaseHelper$SyncData.doInBackground(DatabaseHelper.kt:36) at com.example.mysqlcon.DatabaseHelper$SyncData.doInBackground(DatabaseHelper.kt:23) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Suppressed: java.lang.ClassNotFoundException: org.ietf.jgss.GSSManager 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)
... 17 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 06-19 15:28:48.064 18819-18819/com.example.mysqlcon E/WindowManager: android.view.WindowLeaked: Activity com.example.mysqlcon.InvoiceActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{11c938 V.E..... R......D 0,0-681,215} that was originally added here at android.view.ViewRootImpl.(ViewRootImpl.java:530) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:287) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) at android.app.Dialog.show(Dialog.java:325) at android.app.ProgressDialog.show(ProgressDialog.java:151) at android.app.ProgressDialog.show(ProgressDialog.java:134) at com.example.mysqlcon.DatabaseHelper$SyncData.onPreExecute(DatabaseHelper.kt:31) at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:591) at android.os.AsyncTask.execute(AsyncTask.java:539) at com.example.mysqlcon.DatabaseHelper.getinvoices(DatabaseHelper.kt:92) at com.example.mysqlcon.InvoiceActivity.onCreate(InvoiceActivity.kt:21) at android.app.Activity.performCreate(Activity.java:6609) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3104) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3261) at android.app.ActivityThread.access$1000(ActivityThread.java:219) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1735) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6939) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
You have this:
java.lang.Thread.run(Thread.java:818) Caused by:
java.lang.NoClassDefFoundError: Failed resolution of:
Lorg/ietf/jgss/GSSManager; at
Either you are using an incorrect proguard specification or this class is not available because a dependency is missing.

Android build messed up

I'm developing a game for some time now under cocos2d-js. I was able to add plugin-x and facebook integration to android build. a few days ago I was trying to add admob as another plugin but i came across difficulties. I tried, for the first time ever to add the project to eclipse and try to deal with it there but I came up messing up the whole build. I tried to remove all the additions (admob, facebook, pluginx) and to start all over, but I keep getting this message after compilation & on-device-installation is done:
D/AndroidRuntime( 7513): Shutting down VM
W/dalvikvm( 7513): threadid=1: thread exiting with uncaught exception (group=0x41929ba8)
E/AndroidRuntime( 7513): FATAL EXCEPTION: main
E/AndroidRuntime( 7513): Process: com.shirkan.PiuPiu, PID: 7513
E/AndroidRuntime( 7513): java.lang.UnsatisfiedLinkError: Couldn't load cocos2djs from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shirkan.PiuPiu-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.shirkan.PiuPiu-1, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 7513): at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime( 7513): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 7513): at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:85)
E/AndroidRuntime( 7513): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:99)
E/AndroidRuntime( 7513): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 7513): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 7513): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
E/AndroidRuntime( 7513): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
E/AndroidRuntime( 7513): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 7513): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 7513): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7513): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 7513): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 7513): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7513): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 7513): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 7513): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 7513): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 490): Force finishing activity com.shirkan.PiuPiu/org.cocos2dx.javascript.AppActivity
Can anyone suggest what can cause such error?
Thanks.

android Could not lock surface : dequeueBuffer failed (Unknown error 2147483646)

I am getting this error while navigating through my app.It happens every 5-10 transitions and restarts the app.
here is the exception i got while app crashes.
Please help me to solve the issue.
12-22 16:33:41.625: E/Surface(23199): dequeueBuffer failed (Unknown error 2147483646)
12-22 16:33:41.633: E/ViewRootImpl(23199): Could not lock surface
12-22 16:33:41.633: E/ViewRootImpl(23199): java.lang.IllegalArgumentException
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Surface.nativeLockCanvas(Native Method)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Surface.lockCanvas(Surface.java:243)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2461)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2435)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2279)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1909)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1019)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5725)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Choreographer.doFrame(Choreographer.java:544)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.os.Handler.handleCallback(Handler.java:733)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.os.Handler.dispatchMessage(Handler.java:95)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.os.Looper.loop(Looper.java:136)
12-22 16:33:41.633: E/ViewRootImpl(23199): at android.app.ActivityThread.main(ActivityThread.java:5086)
12-22 16:33:41.633: E/ViewRootImpl(23199): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 16:33:41.633: E/ViewRootImpl(23199): at java.lang.reflect.Method.invoke(Method.java:515)
12-22 16:33:41.633: E/ViewRootImpl(23199): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
12-22 16:33:41.633: E/ViewRootImpl(23199): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
12-22 16:33:41.633: E/ViewRootImpl(23199): at dalvik.system.NativeStart.main(Native Method)
I googled it and came to some of the solutions but they are all about webview.I didn't used webview or SurfaceView in my app.
I have also tried "android:hardwareAccelerated="false" in manifest file but issue still persist.
It was Picasso causing this issue.I was allocating a new object of picasso.Using a Singleton Object of picasso solves the issue.

Why does my map won't work?

Hi :) I have some problem including google maps in my android application. Ive been trying everything including extending MapActivity and adding this line to my project manifest <uses-library android:name="com.google.android.maps" /> . I still get the same errors.
Here is the logcat's output.
12-05 00:03:23.472: E/AndroidRuntime(24182): FATAL EXCEPTION: main
12-05 00:03:23.472: E/AndroidRuntime(24182): Process: com.example.package, PID: 24182
12-05 00:03:23.472: E/AndroidRuntime(24182): java.lang.RuntimeException: Unable to start activity ComponentInfo{...map.Map}: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.gms.maps.MapView
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.access$800(ActivityThread.java:144)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.os.Handler.dispatchMessage(Handler.java:102)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.os.Looper.loop(Looper.java:135)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.main(ActivityThread.java:5221)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Method.invoke(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Method.invoke(Method.java:372)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.gms.maps.MapView
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Activity.setContentView(Activity.java:2144)
12-05 00:03:23.472: E/AndroidRuntime(24182): at ...map.Map.onCreate(Map.java:28)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Activity.performCreate(Activity.java:5933)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 10 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.reflect.InvocationTargetException
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Constructor.newInstance(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 21 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$styleable;
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.google.android.gms.maps.MapView.<init>(Unknown Source)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 24 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.R$styleable" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/.../base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
12-05 00:03:23.472: E/AndroidRuntime(24182): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 26 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.R$styleable
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.Class.classForName(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 27 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
12-05 00:03:25.050: I/Process(24182): Sending signal. PID: 24182 SIG: 9
Here's the only code I have so far
public class Map extends MapActivity {
MapView map_view;
GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_map);
MapsInitializer.initialize(this);
map_view = (MapView) findViewById(R.id.map_view);
map_view.onCreate(savedInstanceState);
map = map_view.getMap();
map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
The code seems to crash at this line : setContentView(R.layout.layout_map);
Thanks !

Android - ClassNotFoundException after refactoring

I've recently refactored class, package and folder names in my app (it's currently called MyApp) using Eclipse's refactor command, and I'm not getting a ClassNotFoundException. I've made sure there are no more instances of the old name anywhere in the code base. I've also deleted all the class files in \bin\classes and generated Java files in \gen (both of which have regenerated, I've checked). I've also updated the API level from 16 to 17 in an attempt to solve the problem. Here is the stack trace:
12-22 17:00:46.690: E/AndroidRuntime(25466): FATAL EXCEPTION: main
12-22 17:00:46.690: E/AndroidRuntime(25466): java.lang.RuntimeException: Unable to instantiate application com.myapp.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.myapp.MyApp" on path: /data/app/com.myapp-2.apk
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.os.Looper.loop(Looper.java:137)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.ActivityThread.main(ActivityThread.java:5039)
12-22 17:00:46.690: E/AndroidRuntime(25466): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 17:00:46.690: E/AndroidRuntime(25466): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 17:00:46.690: E/AndroidRuntime(25466): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-22 17:00:46.690: E/AndroidRuntime(25466): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-22 17:00:46.690: E/AndroidRuntime(25466): at dalvik.system.NativeStart.main(Native Method)
12-22 17:00:46.690: E/AndroidRuntime(25466): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.myapp.MyApp" on path: /data/app/com.myapp-2.apk
12-22 17:00:46.690: E/AndroidRuntime(25466): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
12-22 17:00:46.690: E/AndroidRuntime(25466): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-22 17:00:46.690: E/AndroidRuntime(25466): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.Instrumentation.newApplication(Instrumentation.java:968)
12-22 17:00:46.690: E/AndroidRuntime(25466): at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
12-22 17:00:46.690: E/AndroidRuntime(25466): ... 11 more
Here is my Manifest. I know hardcoding strings is bad style.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="#drawable/ic_launcher"
android:name="MyApp"
android:label="MyApp"
android:theme="#style/NoActionBar">
<activity
android:name=".Otheractivity"
android:label="Otheractivity">
</activity>
<activity
android:name=".MainMenu"
android:label="MainMenu">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any ideas on what the problem could be?
had the same problem, solved it by :
right click your project -> Java build path -> order and export(tab) -> make 'v' on "android private libraries"
tell me if it worked.
android:name="MyApp" in your Manifest means you need to have MyApp.java, declaring the class MyApp extending Application in your com.myapp package.
For those who still get this error in Android Studio, I resolved this by deleting .gradle folder from root directory -> clean and build -> run app again.
with the latest version of eclipse/ adt I get this sometimes when I have external libraries included. Removing them from the build path, and re-adding usually works to fix it.

Categories

Resources