I done few phone gap projects before, This time a new exception raised in my code .
In my new project i include phonegap jar(cordova 1.5) and in the manifest i declared droidgap class(tried with both com.hb.DroidGap and org.apache.cordova.DroidGap).
now if i extend to Activity the debugger entering to onCreate method but if i extend to DroidGap
the below exception is coming and app geting force close (Debugger in not coming to onCreate) ...
Is there any thing i am missing ?
Thanks in advance and sorry for my poor English
06-07 10:03:54.954: E/AndroidRuntime(554): FATAL EXCEPTION: main
06-07 10:03:54.954: E/AndroidRuntime(554): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hiddenbrains/com.hiddenbrains.HBPluginsActivity}: java.lang.ClassNotFoundException: com.hiddenbrains.HBPluginsActivity in loader dalvik.system.PathClassLoader[/data/app/com.hiddenbrains-1.apk]
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.os.Looper.loop(Looper.java:123)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 10:03:54.954: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-07 10:03:54.954: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-07 10:03:54.954: E/AndroidRuntime(554): at dalvik.system.NativeStart.main(Native Method)
06-07 10:03:54.954: E/AndroidRuntime(554): Caused by: java.lang.ClassNotFoundException: com.hiddenbrains.HBPluginsActivity in loader dalvik.system.PathClassLoader[/data/app/com.hiddenbrains-1.apk]
06-07 10:03:54.954: E/AndroidRuntime(554): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
06-07 10:03:54.954: E/AndroidRuntime(554): ... 11 more
I have this exact problem too. Everything was working until a specific time last night, then I started getting these errors. App crashes every time. I have traced the problem to the .java file in src>MyApp.name... if I remove the cordova line, eg. class MyApp extends DroidGap and set it to the default the app doesn't crash, but it doesn't work either.
Related
why does my application crash whenever I inherit from SherlockActivity? It's probably a silly mistake but I really can't figure it out! Just inheriting from Activity does work. Here's the code, layout file, manifest and the logcat logs:
package com.p4p.joinme;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockActivity;
public class MainActivity extends SherlockActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="I'm a textview." />
</LinearLayout>
manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p4p.joinme"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".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>
error logs:
06-07 12:03:22.613: E/ExternalAccountType(21992): Unsupported attribute readOnly
06-07 12:03:23.244: E/ExternalAccountType(21992): Unsupported attribute readOnly
06-07 12:03:25.316: E/AndroidRuntime(9285): FATAL EXCEPTION: main
06-07 12:03:25.316: E/AndroidRuntime(9285): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.p4p.joinme/com.p4p.joinme.MainActivity}: java.lang.ClassNotFoundException: com.p4p.joinme.MainActivity
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread.access$600(ActivityThread.java:139)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.os.Looper.loop(Looper.java:154)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread.main(ActivityThread.java:4945)
06-07 12:03:25.316: E/AndroidRuntime(9285): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 12:03:25.316: E/AndroidRuntime(9285): at java.lang.reflect.Method.invoke(Method.java:511)
06-07 12:03:25.316: E/AndroidRuntime(9285): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-07 12:03:25.316: E/AndroidRuntime(9285): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-07 12:03:25.316: E/AndroidRuntime(9285): at dalvik.system.NativeStart.main(Native Method)
06-07 12:03:25.316: E/AndroidRuntime(9285): Caused by: java.lang.ClassNotFoundException: com.p4p.joinme.MainActivity
06-07 12:03:25.316: E/AndroidRuntime(9285): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-07 12:03:25.316: E/AndroidRuntime(9285): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-07 12:03:25.316: E/AndroidRuntime(9285): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
06-07 12:03:25.316: E/AndroidRuntime(9285): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
06-07 12:03:25.316: E/AndroidRuntime(9285): ... 11 more
06-07 12:03:25.326: E/EmbeddedLogger(239): App crashed! Process: com.p4p.joinme
06-07 12:03:25.326: E/EmbeddedLogger(239): App crashed! Package: com.p4p.joinme v1 (1.0)
06-07 12:03:25.326: E/EmbeddedLogger(239): Application Label: JoinMe!
06-07 12:07:33.959: E/ExternalAccountType(21992): Unsupported attribute readOnly
06-07 12:07:34.299: E/ExternalAccountType(21992): Unsupported attribute readOnly
06-07 12:07:37.452: E/EmbeddedLogger(239): App crashed! Process: com.p4p.joinme
06-07 12:07:37.452: E/EmbeddedLogger(239): App crashed! Package: com.p4p.joinme v1 (1.0)
06-07 12:07:37.452: E/AndroidRuntime(9610): FATAL EXCEPTION: main
06-07 12:07:37.452: E/AndroidRuntime(9610): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.p4p.joinme/com.p4p.joinme.MainActivity}: java.lang.ClassNotFoundException: com.p4p.joinme.MainActivity
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread.access$600(ActivityThread.java:139)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.os.Looper.loop(Looper.java:154)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread.main(ActivityThread.java:4945)
06-07 12:07:37.452: E/AndroidRuntime(9610): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 12:07:37.452: E/AndroidRuntime(9610): at java.lang.reflect.Method.invoke(Method.java:511)
06-07 12:07:37.452: E/AndroidRuntime(9610): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-07 12:07:37.452: E/AndroidRuntime(9610): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-07 12:07:37.452: E/AndroidRuntime(9610): at dalvik.system.NativeStart.main(Native Method)
06-07 12:07:37.452: E/AndroidRuntime(9610): Caused by: java.lang.ClassNotFoundException: com.p4p.joinme.MainActivity
06-07 12:07:37.452: E/AndroidRuntime(9610): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-07 12:07:37.452: E/AndroidRuntime(9610): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-07 12:07:37.452: E/AndroidRuntime(9610): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
06-07 12:07:37.452: E/AndroidRuntime(9610): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
06-07 12:07:37.452: E/AndroidRuntime(9610): ... 11 more
06-07 12:07:37.472: E/EmbeddedLogger(239): Application Label: JoinMe!
06-07 12:07:38.933: E/ActivityManager(239): fail to set top app changed!
I have had the same issue about external library, maybe your external library is not exported to your apk, I suggest you to see this: Could not find class
You probably haven't linked the library correctly, make sure you added it to the library section in rightclick -> properies -> Android.
There is no issue on your code. Jst cross check with your library whether it is linked in your project.
Steps to cross check is rightclick on projct -> properies -> Android/ java build path
use below code:
<activity
android:name="com.p4p.joinme.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>
clean your project and run..
I'm not sure if this has something to do with your error, but if you want to use Sherlock Action Bar you need to use their theme:
<application
android:allowBackup="false"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock" >
Besides, if you just updated your ADT plugin you might need to check your Private Libraries in Java Build Path.
Right click on project->Properties->Java Build Path->Order and Export(tab)->Activate checkbox next to Andrid Private Libraries
i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.
I am trying to setup ad in my game but I am having a problem. It seems to be crashing. I have included the logcat below and it has something to do with the ad it seems.
06-07 18:49:54.594: E/dalvikvm(308): Could not find class 'com.google.ads.AdView', referenced from method com.blockyblaine.bobhoil.BlockyBlaine.onCreate
06-07 18:49:54.594: W/dalvikvm(308): VFY: unable to resolve check-cast 17 (Lcom/google/ads/AdView;) in Lcom/blockyblaine/bobhoil/BlockyBlaine;
06-07 18:49:54.603: D/dalvikvm(308): VFY: replacing opcode 0x1f at 0x0011
06-07 18:49:54.603: D/dalvikvm(308): VFY: dead code 0x0013-0069 in Lcom/blockyblaine/bobhoil/BlockyBlaine;.onCreate (Landroid/os/Bundle;)V
06-07 18:49:54.933: D/AndroidRuntime(308): Shutting down VM
06-07 18:49:54.933: W/dalvikvm(308): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-07 18:49:55.014: E/AndroidRuntime(308): FATAL EXCEPTION: main
06-07 18:49:55.014: E/AndroidRuntime(308): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.blockyblaine.bobhoil/com.blockyblaine.bobhoil.BlockyBlaine}: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.ads.AdView
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.os.Looper.loop(Looper.java:123)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-07 18:49:55.014: E/AndroidRuntime(308): at dalvik.system.NativeStart.main(Native Method)
06-07 18:49:55.014: E/AndroidRuntime(308): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.ads.AdView
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.Activity.setContentView(Activity.java:1647)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.blockyblaine.bobhoil.BlockyBlaine.onCreate(BlockyBlaine.java:27)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-07 18:49:55.014: E/AndroidRuntime(308): ... 11 more
06-07 18:49:55.014: E/AndroidRuntime(308): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader[/data/app/com.blockyblaine.bobhoil-2.apk]
06-07 18:49:55.014: E/AndroidRuntime(308): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
06-07 18:49:55.014: E/AndroidRuntime(308): ... 20 more
06-07 18:50:01.593: I/Process(308): Sending signal. PID: 308 SIG: 9
This link will take you to the admob developers docs. You will need to be sure to follow the directions to have the admob JAR included in your project.
I found a couple of other mentions related to other google api's. The issue there (giving a similar logcat) was this step was missed:
2. Declare com.google.ads.AdActivity in AndroidManifest.xml.
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
When I run my app in landscape mode it has no issues nor does it have any issues in portrait mode until i try to add an item to one of my lists while still in portrait mode, where of which my app crashes.
any ideas on how to fix this??
here is the error I am getting as feedback in logcat....
03-08 13:30:50.201: D/AndroidRuntime(554): Shutting down VM
03-08 13:30:50.201: W/dalvikvm(554): threadid=1: thread exiting with uncaught exception (group=0x40014760)
03-08 13:30:50.229: E/AndroidRuntime(554): FATAL EXCEPTION: main
03-08 13:30:50.229: E/AndroidRuntime(554): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ATG.C3FactSystemTabbed/com.ATG.EditActivities.AmenitiesEditActivity}: java.lang.NullPointerException
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1748)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.os.Handler.dispatchMessage(Handler.java:99)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.os.Looper.loop(Looper.java:132)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread.main(ActivityThread.java:4025)
03-08 13:30:50.229: E/AndroidRuntime(554): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 13:30:50.229: E/AndroidRuntime(554): at java.lang.reflect.Method.invoke(Method.java:491)
03-08 13:30:50.229: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
03-08 13:30:50.229: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
03-08 13:30:50.229: E/AndroidRuntime(554): at dalvik.system.NativeStart.main(Native Method)
03-08 13:30:50.229: E/AndroidRuntime(554): Caused by: java.lang.NullPointerException
03-08 13:30:50.229: E/AndroidRuntime(554): at com.ATG.EditActivities.AmenitiesEditActivity.registerButtonListenersAndSetDefaultText(AmenitiesEditActivity.java:68)
03-08 13:30:50.229: E/AndroidRuntime(554): at com.ATG.EditActivities.AmenitiesEditActivity.onCreate(AmenitiesEditActivity.java:61)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
03-08 13:30:50.229: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1712)
03-08 13:30:50.229: E/AndroidRuntime(554): ... 11 more
this is the line that throws the exception
btnSave.setOnClickListener(new View.OnClickListener(){ <-------
#Override
public void onClick(View v){
. . . . .
}
});
this is only thrown when I am in portrait mode, it never gets thrown unless i change the orientation before trying to add something to the list. And if i already have the view open to add something no matter how i change the orientation it won't force close.
okay so i checked the files again i had different names for the buttons i was referencing in different xml files. In other words in landscape i was calling the button btnSave and in the other i was calling it btnAmenitiesSave. Problem solved thanks everyone!!!!!!
btnSave is set to null in portrait.
It means :
btnSave is not assigned ( no btnSave = findViewById(....) )
or the id the_id specified in btnSave = findViewById(R.id.the_id) does not exist in the portait layout
Why does my video playing app crash when I try to run on a Droid 2.1 device, but works fine with myTouch 1.6?
Thanks
Chris
LogCat shows
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): java.lang.IllegalStateException
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer.getVideoWidth(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.widget.VideoView$2.onPrepared(VideoView.java:290)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1152)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Looper.loop(Looper.java:123)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.app.ActivityThread.main(ActivityThread.java:4363)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at dalvik.system.NativeStart.main(Native Method)
This VideoView-based sample works fine on all Android devices I have tested it upon, including the Magic and DROID. Experiment with it and your media clip and see what happens.