After init FacebookSdk manually in my appliction
FacebookSdk.sdkInitialize(getApplicationContext());
When i play RewardedVideo of Admob,the app crashed:
Here is the crash log
01-05 17:27:47.780 E/AndroidRuntime(32002): FATAL EXCEPTION: main
01-05 17:27:47.780 E/AndroidRuntime(32002): Process: com.vikings.hl, PID: 32002
01-05 17:27:47.780 E/AndroidRuntime(32002): java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/AppLinks;
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:131)
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:77)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.Application.dispatchActivityCreated(Application.java:197)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.Activity.onCreate(Activity.java:1008)
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.google.android.gms.ads.AdActivity.onCreate(Unknown Source)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.Activity.performCreate(Activity.java:6910)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.ActivityThread.-wrap12(ActivityThread.java)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.os.Handler.dispatchMessage(Handler.java:105)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.os.Looper.loop(Looper.java:156)
01-05 17:27:47.780 E/AndroidRuntime(32002): at android.app.ActivityThread.main(ActivityThread.java:6523)
01-05 17:27:47.780 E/AndroidRuntime(32002): at java.lang.reflect.Method.invoke(Native Method)
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
01-05 17:27:47.780 E/AndroidRuntime(32002): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
01-05 17:27:47.780 E/AndroidRuntime(32002): Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.AppLinks" on path: DexPathList[[zip file "/data/app/com.vikings.hl-1/base.apk"],nativeLibraryDirectories=[/data/app/com.vikings.hl-1/lib/arm, /system/fake-libs, /data/app/com.vikings.hl-1/base.apk!/lib/armeabi, /system/lib, /vendor/lib, /system/vendor/lib, /product/lib]]
01-05 17:27:47.780 E/AndroidRuntime(32002): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-05 17:27:47.780 E/AndroidRuntime(32002): at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
01-05 17:27:47.780 E/AndroidRuntime(32002): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
01-05 17:27:47.780 E/AndroidRuntime(32002): ... 18 more
its seems "bolts.AppLinks" is belong to FaceBookSdk,when id didnt init FaceBookSdk,everything is ok,did anyone have meet this problem?
Related
I am using geocoder to get the address but I am getting exception all the time
I have gone through many links in stack over flow but couldnt find any solution
addressList = geocoder.getFromLocation(
latitude, longitude, 1);
this is the exception
java.io.IOException: Timed out waiting for response from server
01-05 17:35:03.915 8708-8708/com.mindtree.vishram W/System.err: at android.location.Geocoder.getFromLocation(Geocoder.java:136)
01-05 17:35:03.915 8708-8708/com.mindtree.vishram W/System.err: at com.mindtree.vishram.presenter.FragmentPresenters.OrderMedDeliveryAddressPresenter.getAddressFromGeoCordinates(OrderMedDeliveryAddressPresenter.java:90)
01-05 17:35:03.915 8708-8708/com.mindtree.vishram W/System.err: at com.mindtree.vishram.presenter.FragmentPresenters.OrderMedDeliveryAddressPresenter.getGeoCordinates(OrderMedDeliveryAddressPresenter.java:76)
01-05 17:35:03.916 8708-8708/com.mindtree.vishram W/System.err: at com.mindtree.vishram.presenter.FragmentPresenters.OrderMedDeliveryAddressPresenter.currentLocationImageViewClick(OrderMedDeliveryAddressPresenter.java:42)
01-05 17:35:03.916 8708-8708/com.mindtree.vishram W/System.err: at com.mindtree.vishram.view.FragmentViews.OrderMedicineDeliveryAddressfrag$1.onClick(OrderMedicineDeliveryAddressfrag.java:67)
01-05 17:35:03.917 8708-8708/com.mindtree.vishram W/System.err: at android.view.View.performClick(View.java:5204)
01-05 17:35:03.917 8708-8708/com.mindtree.vishram W/System.err: at android.view.View$PerformClick.run(View.java:21153)
01-05 17:35:03.917 8708-8708/com.mindtree.vishram W/System.err: at android.os.Handler.handleCallback(Handler.java:739)
01-05 17:35:03.917 8708-8708/com.mindtree.vishram W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
01-05 17:35:03.918 8708-8708/com.mindtree.vishram W/System.err: at android.os.Looper.loop(Looper.java:148)
01-05 17:35:03.918 8708-8708/com.mindtree.vishram W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
01-05 17:35:03.918 8708-8708/com.mindtree.vishram W/System.err: at java.lang.reflect.Method.invoke(Native Method)
01-05 17:35:03.918 8708-8708/com.mindtree.vishram W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-05 17:35:03.918 8708-8708/com.mindtree.vishram W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I have an android project. After compile and install on Android 4.0, it can works normally. But when install it on Android 5.0 and launch it, exception is thrown such as "android.view.InflateException: Binary XML file line #40: Error inflating class android.widget.Toolbar".
Is there any change on between Android 5.0 and before version?
Below is the error log
01-05 18:40:40.540: E/AndroidRuntime(18827): FATAL EXCEPTION: main
01-05 18:40:40.540: E/AndroidRuntime(18827): Process: com.example.sbp_client_test, PID: 18827
01-05 18:40:40.540: E/AndroidRuntime(18827): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sbp_client_test/com.example.sbp_client_test.MainActivity}: android.view.InflateException: Binary XML file line #40: Error inflating class android.widget.Toolbar
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread.access$800(ActivityThread.java:144)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.os.Handler.dispatchMessage(Handler.java:102)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.os.Looper.loop(Looper.java:135)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread.main(ActivityThread.java:5221)
01-05 18:40:40.540: E/AndroidRuntime(18827): at java.lang.reflect.Method.invoke(Native Method)
01-05 18:40:40.540: E/AndroidRuntime(18827): at java.lang.reflect.Method.invoke(Method.java:372)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
01-05 18:40:40.540: E/AndroidRuntime(18827): Caused by: android.view.InflateException: Binary XML file line #40: Error inflating class android.widget.Toolbar
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3489)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3561)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:367)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.Activity.setContentView(Activity.java:2144)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ListActivity.ensureList(ListActivity.java:312)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ListActivity.setListAdapter(ListActivity.java:263)
01-05 18:40:40.540: E/AndroidRuntime(18827): at com.example.sbp_client_test.MainActivity.onCreate(MainActivity.java:167)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.Activity.performCreate(Activity.java:5933)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
01-05 18:40:40.540: E/AndroidRuntime(18827): ... 10 more
01-05 18:40:40.540: E/AndroidRuntime(18827): Caused by: java.lang.reflect.InvocationTargetException
01-05 18:40:40.540: E/AndroidRuntime(18827): at java.lang.reflect.Constructor.newInstance(Native Method)
01-05 18:40:40.540: E/AndroidRuntime(18827): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
01-05 18:40:40.540: E/AndroidRuntime(18827): ... 28 more
01-05 18:40:40.540: E/AndroidRuntime(18827): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RtlSpacingHelper.setDirection(boolean)' on a null object reference
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.widget.Toolbar.onRtlPropertiesChanged(Toolbar.java:296)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.View.resolvePadding(View.java:13245)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.ViewGroup.resolvePadding(ViewGroup.java:6032)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.View.initializeScrollbarsInternal(View.java:4558)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.View.<init>(View.java:4150)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.view.ViewGroup.<init>(ViewGroup.java:491)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.widget.Toolbar.<init>(Toolbar.java:183)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.widget.Toolbar.<init>(Toolbar.java:179)
01-05 18:40:40.540: E/AndroidRuntime(18827): at android.widget.Toolbar.<init>(Toolbar.java:175)
01-05 18:40:40.540: E/AndroidRuntime(18827): ... 31 more
I downloaded a library called Android Maps Extensions from Github.
I can run the demo of this library in debugging mode, on my Samsung Note (GT-N7000) which runs Android 4.0.4.
If I click a button inside app, the app will stop and the screen will become black and after several seconds, and a dialog appears saying:
Unfortunately, Android Maps Extensions has stopped.
I am not sure what is happening. The logcat output can be seen below:
01-05 01:09:17.118: I/Process(24896): Sending signal. PID: 24896 SIG: 9
01-05 01:26:43.328: D/CLIPBOARD(27226): Hide Clipboard dialog at Starting input: finished by someone else... !
01-05 01:27:09.043: D/dalvikvm(27226): GC_CONCURRENT freed 56K, 2% free 14452K/14663K, paused 2ms+3ms
01-05 01:27:09.053: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.053: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.053: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.053: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.058: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.058: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.058: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.058: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.063: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.063: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.078: W/GooglePlayServicesUtil(27226): Certificate is not yet valid.
01-05 01:27:09.078: W/GooglePlayServicesUtil(27226): Google Play Store signature invalid.
01-05 01:27:09.078: D/AndroidRuntime(27226): Shutting down VM
01-05 01:27:09.078: W/dalvikvm(27226): threadid=1: thread exiting with uncaught exception (group=0x40c4f1f8)
01-05 01:27:09.083: E/AndroidRuntime(27226): FATAL EXCEPTION: main
01-05 01:27:09.083: E/AndroidRuntime(27226): java.lang.RuntimeException: Unable to start activity ComponentInfo{pl.mg6.android.maps.extensions.demo/pl.mg6.android.maps.extensions.demo.DemoActivity}: java.lang.NullPointerException
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread.access$600(ActivityThread.java:127)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.os.Handler.dispatchMessage(Handler.java:99)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.os.Looper.loop(Looper.java:137)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread.main(ActivityThread.java:4511)
01-05 01:27:09.083: E/AndroidRuntime(27226): at java.lang.reflect.Method.invokeNative(Native Method)
01-05 01:27:09.083: E/AndroidRuntime(27226): at java.lang.reflect.Method.invoke(Method.java:511)
01-05 01:27:09.083: E/AndroidRuntime(27226): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
01-05 01:27:09.083: E/AndroidRuntime(27226): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
01-05 01:27:09.083: E/AndroidRuntime(27226): at dalvik.system.NativeStart.main(Native Method)
01-05 01:27:09.083: E/AndroidRuntime(27226): Caused by: java.lang.NullPointerException
01-05 01:27:09.083: E/AndroidRuntime(27226): at pl.mg6.android.maps.extensions.demo.DemoActivity.addCircles(DemoActivity.java:220)
01-05 01:27:09.083: E/AndroidRuntime(27226): at pl.mg6.android.maps.extensions.demo.DemoActivity.onCreate(DemoActivity.java:84)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.Activity.performCreate(Activity.java:4470)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
01-05 01:27:09.083: E/AndroidRuntime(27226): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
01-05 01:27:09.083: E/AndroidRuntime(27226): ... 11 more
When I run my android UIAutomator code, it shows following error.
INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
INSTRUMENTATION_RESULT: longMsg=com.android.ui.testing
INSTRUMENTATION_CODE: 0
I just ran the sample code given in developer.android.com
How to solve this error?
Log attached below:
01-05 01:07:53.559: D/AndroidRuntime(5712): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-05 01:07:53.559: D/AndroidRuntime(5712): CheckJNI is ON
01-05 01:07:53.559: E/AndroidRuntime(5712): cannot open customer xml file
01-05 01:07:53.559: E/AndroidRuntime(5712): /system/csc/customer.xml can't open file
01-05 01:07:53.564: D/AndroidRuntime(5712): readGMSProperty: start
01-05 01:07:53.564: D/AndroidRuntime(5712): readGMSProperty: already setted!!
01-05 01:07:53.564: D/AndroidRuntime(5712): readGMSProperty: end
01-05 01:07:53.589: D/dalvikvm(5712): Trying to load lib libjavacore.so 0x0
01-05 01:07:53.599: D/dalvikvm(5712): Added shared lib libjavacore.so 0x0
01-05 01:07:53.609: D/dalvikvm(5712): Trying to load lib libnativehelper.so 0x0
01-05 01:07:53.609: D/dalvikvm(5712): Added shared lib libnativehelper.so 0x0
01-05 01:07:53.664: I/dalvikvm(5712): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
01-05 01:07:53.874: D/dalvikvm(5712): Note: class Landroid/app/ActivityManagerNative; has 152 unimplemented (abstract) methods
01-05 01:07:53.924: D/AndroidRuntime(5712): Calling main entry com.android.commands.uiautomator.Launcher
01-05 01:07:53.934: D/AndroidRuntime(5712): Shutting down VM
01-05 01:07:53.934: W/dalvikvm(5712): threadid=1: thread exiting with uncaught exception (group=0x40ffa2a0)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): uncaught exception
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): java.lang.RuntimeException: com.uia.example.my.LaunchSettings
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:95)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:82)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:76)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:237)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at dalvik.system.NativeStart.main(Native Method)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): Caused by: java.lang.ClassNotFoundException: com.uia.example.my.LaunchSettings
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.TestCaseCollector.addTestClass(TestCaseCollector.java:83)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.TestCaseCollector.addTestClass(TestCaseCollector.java:71)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.TestCaseCollector.addTestClasses(TestCaseCollector.java:52)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:92)
01-05 01:07:53.939: E/UiAutomatorTestRunner(5712): ... 6 more
01-05 01:07:53.944: I/AndroidRuntime(5712): VM exiting with result code -1.
If you get a ClassNotFindException while running your uiautomator tests :
Some of us my get this error because their ROM puts the folder /data/dalvik-cache in read-only mode. That happened to me with Cyanogen for a S3.
In that case type, in bash :
adb shell
su
chmod 777 /data/dalvik-cache
exit
rerun your tests and that should work. As dalvik-cache is locked for apps, uiautomator can't ask dalvik to unzip the jar of your tests and dalvik won't find the its classes.
See if removing the #UiThreadTest annotation or removing the runOnUiThread() call or re-factoring your tests work. But without a logcat, difficult to understand where it's coming from.
Had the same problem. Most demos I've seen indicate to install the jar to /data/local/tmp/. I've seen others indicate to try and install it to your sd card (/storage/sdcard0). After doing that it worked. Seems to be a problem with read permissions.
I solved this error by using"ant build" to create my jar.If u use export in eclipse to create a jar file, there might be some errors in the resulting class file, hence the above class not found error.
I coded a Dialog that shows up with 2 textviews and 2 buttons.
I googled for that Problem as well but I didn't find anything that mathced my issue.
Here is some Code:
case R.id.open:
openDialog=new Dialog(this);
openDialog.setContentView(R.layout.open_dialog);
openDialog.setTitle(head);
openDialog.setCancelable(true);
Button open_cancel=(Button)findViewById(R.id.open_cancel);
open_cancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
openDialog.cancel();
}
});
but I can't show the dialog up with the buttons.
If I call it without these Lines there is no Problem:
Button open_cancel=(Button)findViewById(R.id.open_cancel);
open_cancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
openDialog.cancel();
}
});
This is the XML File:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/open_dialog"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
>
<EditText android:id="#+id/open_head"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:text="ojfpojew ojr pojr"
/>
<EditText android:id="#+id/open_note"
android:layout_width="fill_parent"
android:text="oijpojepojpotjpotejpe ojtpojtpo ewpoj tpojt pp jpojtpoj etpoj poj poj t"
android:layout_height="150dp"
/>
<Button android:id="#+id/open_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="edit"
/>
<Button android:id="#+id/open_cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="cancel"
/>
</LinearLayout>
I really do not understand why this not works...
here is the error log, if it helps:
01-05 16:43:51.004: D/dalvikvm(2336): GC freed 1010 objects / 70136 bytes in 75ms
01-05 16:43:51.204: D/dalvikvm(2336): GC freed 91 objects / 3664 bytes in 53ms
01-05 16:43:51.494: D/dalvikvm(2336): GC freed 132 objects / 6240 bytes in 62ms
01-05 16:43:51.674: D/dalvikvm(2336): GC freed 58 objects / 2312 bytes in 56ms
01-05 16:43:51.944: D/dalvikvm(2336): GC freed 147 objects / 9128 bytes in 63ms
01-05 16:43:52.383: D/ViewFlipper(2336): updateRunning() mVisible=true, mStarted=false, mUserPresent=true, mRunning=false
01-05 16:44:00.973: D/dalvikvm(2336): GC freed 25495 objects / 1393728 bytes in 88ms
01-05 16:44:02.644: D/dalvikvm(2336): GC freed 45722 objects / 2044568 bytes in 102ms
01-05 16:44:04.424: I/Resources(2336): Loaded time zone names for en in 1591ms.
01-05 16:44:06.834: D/dalvikvm(2336): GC freed 36788 objects / 1674624 bytes in 102ms
01-05 16:44:11.243: D/AndroidRuntime(2336): Shutting down VM
01-05 16:44:11.263: W/dalvikvm(2336): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
01-05 16:44:11.263: E/AndroidRuntime(2336): Uncaught handler: thread main exiting due to uncaught exception
01-05 16:44:11.273: E/AndroidRuntime(2336): java.lang.NullPointerException
01-05 16:44:11.273: E/AndroidRuntime(2336): at producteev.push.Producteev_pushActivity.onContextItemSelected(Producteev_pushActivity.java:247)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.app.Activity.onMenuItemSelected(Activity.java:2174)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback.onMenuItemSelected(PhoneWindow.java:2731)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:129)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:884)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.widget.ListView.performItemClick(ListView.java)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.os.Handler.handleCallback(Handler.java:587)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.os.Handler.dispatchMessage(Handler.java:92)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.os.Looper.loop(Looper.java:123)
01-05 16:44:11.273: E/AndroidRuntime(2336): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-05 16:44:11.273: E/AndroidRuntime(2336): at java.lang.reflect.Method.invokeNative(Native Method)
01-05 16:44:11.273: E/AndroidRuntime(2336): at java.lang.reflect.Method.invoke(Method.java:521)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-05 16:44:11.273: E/AndroidRuntime(2336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-05 16:44:11.273: E/AndroidRuntime(2336): at dalvik.system.NativeStart.main(Native Method)
01-05 16:44:11.293: I/dalvikvm(2336): threadid=7: reacting to signal 3
01-05 16:44:11.323: I/dalvikvm(2336): Wrote stack trace to '/data/anr/traces.txt'
01-05 16:44:13.383: I/Process(2336): Sending signal. PID: 2336 SIG: 9
Try this,
Button open_cancel=(Button)openDialog.findViewById(R.id.open_cancel);