I have installed android sdk from this link http://developer.android.com/sdk/index.html.(installer_r18-windows.... android app is working fine.but my phonegap app is not running.same phonegap app is working in installer_r12-windows.exe
Error Message
05-03 19:55:36.310: E/AndroidRuntime(743): FATAL EXCEPTION: main
05-03 19:55:36.310: E/AndroidRuntime(743): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.app.mobilyzer/com.app.mobilyzer.MobilyzerActivity}: java.lang.ClassNotFoundException: com.app.mobilyzer.MobilyzerActivity
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.os.Looper.loop(Looper.java:137)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-03 19:55:36.310: E/AndroidRuntime(743): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 19:55:36.310: E/AndroidRuntime(743): at java.lang.reflect.Method.invoke(Method.java:511)
05-03 19:55:36.310: E/AndroidRuntime(743): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-03 19:55:36.310: E/AndroidRuntime(743): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-03 19:55:36.310: E/AndroidRuntime(743): at dalvik.system.NativeStart.main(Native Method)
05-03 19:55:36.310: E/AndroidRuntime(743): Caused by: java.lang.ClassNotFoundException: com.app.mobilyzer.MobilyzerActivity
05-03 19:55:36.310: E/AndroidRuntime(743): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-03 19:55:36.310: E/AndroidRuntime(743): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-03 19:55:36.310: E/AndroidRuntime(743): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-03 19:55:36.310: E/AndroidRuntime(743): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
05-03 19:55:36.310: E/AndroidRuntime(743): ... 11 more
You have placed you Jar file in some random folder and then did "Add to build path". This will work in versions older than r17. But now you have to create a folder named libs in your project folder and then just add the phonegap jar file in it and automatically it will be added to class path. And you will not get this issue.
Declare the activity in the Android Manifest? Make sure the launcher activity has the right name? Both possible solutions :D
Related
I recently moved to MoPub and it all appears to be working well except for I have started getting this exception saying that com.millennialmedia.android.VideoPlayer can not be found. I looked and it isn't on the Millennial jar (I just got the latest from their site). Also my AndroidManifest mentions that class and Android Studio also says it can't be found.
This is what I have there:
<activity android:name="com.millennialmedia.android.MMActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation|keyboard" />
<activity android:name="com.millennialmedia.android.VideoPlayer" android:configChanges="keyboardHidden|orientation|keyboard" />
On Android Studio the VideoPlayer part is red.
This is the exception I got:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{mypackage/com.millennialmedia.android.VideoPlayer}: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.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.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Looking at the latest Millennial Media documentation, it looks like
com.millennialmedia.android.VideoPlayer
isn't included. This may be an update that needs to be made.
Alice
We tried integrating HelpStack by following steps given on GitHub, but we kept getting the following errors:
04-03 13:54:22.054 4638-4638/com.playerline.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playerline.android/com.tenmiles.helpstack.activities.HomeActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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.NullPointerException
at com.tenmiles.helpstack.activities.HSActivityParent.onCreate(HSActivityParent.java:48)
at com.tenmiles.helpstack.activities.HomeActivity.onCreate(HomeActivity.java:46)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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)
I'm guessing it has something to do with the App Theme, which in our case is is Theme.AppCompat.NoActionBar.
I wanted to obtain user access token for my application to access logged-in user's photos etc. I created a login button as given on facebook android SDK tutorials. I am able to get access token for my admin account which created this application on facebook.
But when I login with any other account, it throws following exception:
I don't understand what I am doing wrong. Ideally, all other persons should be able to login to this app. I am testing it on an emulator. Could it be a problem?
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): Exception during service
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): com.facebook.orca.protocol.base.ApiException: Invalid application 332039450257790
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.protocol.base.ApiResponseChecker.b(ApiResponseChecker.java:74)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.protocol.base.ApiResponseChecker.a(ApiResponseChecker.java:103)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.protocol.base.ApiResponse.g(ApiResponse.java:208)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:267)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:28)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.protocol.base.SingleMethodRunner.a(SingleMethodRunner.java:125)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:274)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:175)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:218)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:38)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at com.facebook.orca.server.OrcaServiceQueue$3.run(OrcaServiceQueue.java:169)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at android.os.Handler.handleCallback(Handler.java:587)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at android.os.Handler.dispatchMessage(Handler.java:92)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at android.os.Looper.loop(Looper.java:123)
05-03 01:29:09.618: W/fb4a:fb:OrcaServiceQueue(352): at android.os.HandlerThread.run(HandlerThread.java:60)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): Failed to send
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): com.facebook.orca.ops.ServiceException: API_ERROR: API_ERROR
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:610)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:40)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at com.facebook.orca.ops.OrcaServiceOperation$2.run(OrcaServiceOperation.java:575)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at android.os.Handler.handleCallback(Handler.java:587)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at android.os.Handler.dispatchMessage(Handler.java:92)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at android.os.Looper.loop(Looper.java:123)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at java.lang.reflect.Method.invoke(Method.java:521)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-03 01:29:09.628: W/fb4a:fb:GDPDialog(352): at dalvik.system.NativeStart.main(Native Method)
Actually during app creation, I had wrongly selected 'sandboxed' mode which restricts app's access only to developers added in app configuration page. So after disabling this mode, I was able to generate access token for other users too.
I am creating multiple activities in Android, this is my logcat error output.
log.txt
05-03 03:17:23.295: E/PhonePolicy(1854): Could not preload class for phone policy: com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
05-03 03:17:37.044: W/dalvikvm(1854): threadid=1: thread exiting with uncaught exception (group=0x409db1f8)
05-03 03:17:37.044: E/AndroidRuntime(1854): FATAL EXCEPTION: main
05-03 03:17:37.044: E/AndroidRuntime(1854): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jumoun.itemp/com.jumoun.itemp.Converter}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.os.Looper.loop(Looper.java:137)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread.main(ActivityThread.java:4427)
05-03 03:17:37.044: E/AndroidRuntime(1854): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 03:17:37.044: E/AndroidRuntime(1854): at java.lang.reflect.Method.invoke(Method.java:511)
05-03 03:17:37.044: E/AndroidRuntime(1854): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
05-03 03:17:37.044: E/AndroidRuntime(1854): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
05-03 03:17:37.044: E/AndroidRuntime(1854): at dalvik.system.NativeStart.main(Native Method)
05-03 03:17:37.044: E/AndroidRuntime(1854): Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
05-03 03:17:37.044: E/AndroidRuntime(1854): at com.jumoun.itemp.Converter.onCreate(Converter.java:41)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.Activity.performCreate(Activity.java:4465)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-03 03:17:37.044: E/AndroidRuntime(1854): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-03 03:17:37.044: E/AndroidRuntime(1854): ... 11 more
05-03 03:17:38.704: I/Process(1854): Sending signal. PID: 1854 SIG: 9
This is my java file Converter.java
http://pastebin.com/VNNPy7D5
Thanks guys :)
If I counted right this
ibHome3 = (Button) findViewById(R.id.ibHome3);
is causing your problem. You have it as an ImageButton in your xml but Button in your java declaration. Just change it to
ImageButton ibHome3;
About Logcat
Also, just a little advice on logcat. If you find the first line that says Caused By after Fatal Exception you can track down your problem easier. Here it is
Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
this gives the exception
java.lang.ClassCastException
then find the first line after that which references your package. Here
at com.jumoun.itemp.Converter.onCreate(Converter.java:41)
this tells us the problem starts in Converter.java at line 41
You have two buttons in your layout file, right? They looks to be defined as ImageButton in the XML file. In your Activity, you declare it as Button and try to convert with a cast to (Button). Change your type to ImageButton on your Activity file. It may solve your prolbem.
On line 41, you have to cast your button to ImageButton and not Button :
ibHome3 = (ImageButton) findViewById(R.id.ibHome3);
I am using greenDao to access database in my Android phone. Everything seems fine, and complied. But when I run the program, it crashed at DaoMaster.java -> OpenHelper class, onCreate method at createAllTables(db, false);
Below are the Exception message:
>05-03 15:40:34.109: E/AndroidRuntime(28587): FATAL EXCEPTION: main
05-03 15:40:34.109: E/AndroidRuntime(28587): java.lang.NoClassDefFoundError: com.hook38.sporttimer.model.sql.DaoMaster
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.hook38.sporttimer.model.sql.DaoMaster$OpenHelper.onCreate(DaoMaster.java:42)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:165)
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.hook38.sporttimer.controller.CountdownTimerStoreController.<init>(CountdownTimerStoreController.java:32)
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.hook38.sporttimer.controller.CountdownTimerController.<init>(CountdownTimerController.java:57)
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.hook38.sporttimer.CountDownTimerActivity.onCreate(CountDownTimerActivity.java:49)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.Activity.performCreate(Activity.java:4465)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.os.Looper.loop(Looper.java:137)
05-03 15:40:34.109: E/AndroidRuntime(28587): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-03 15:40:34.109: E/AndroidRuntime(28587): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 15:40:34.109: E/AndroidRuntime(28587): at java.lang.reflect.Method.invoke(Method.java:511)
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-03 15:40:34.109: E/AndroidRuntime(28587): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-03 15:40:34.109: E/AndroidRuntime(28587): at dalvik.system.NativeStart.main(Native Method)
I did some research on NoClassDefFoundError, and it means CLASSPATH was not set properly. but I checked the build path, greenDao.jar is in the library. Is there something I miss out??
I solved the problem. I was using the greenDao.jar file from the DaoExample project. The way to solve this is... remove the original greenDao.jar from my java build path. Make a folder call libs under my project. copy the geenDao.jar file from the libs folder in DaoExample project, and paste it into the libs file in my own project. Go to Java build path, libraries, import jar, and add the newly pasted jar file. wala~
The solution is ultra simple - Ensure Maven Dependencies are exported:
Project Properties -> Java Build Path -> Order and Export -> Tick Maven Dependencies
Clean Project