Android Closing My Application Without Any Notification - android

I am working on Card Scanner application, Using native camera and barcode scanning apis in my app(everything is fine with camera and barcode sanning), also using Spring Android library with Java POJO Objects for in/out to Rest apis.
ISSUE
Android is closing my application without any notification, QA reported a bug that he was testing and suddenly app closed(behavior is similar to home button press).
I don't have any idea about this issue. I reproduced this issue at my end and got below mentioned logs in logcat.
Here is my logs:
01-29 14:35:00.805: E/AndroidRuntime(25696): FATAL EXCEPTION: main
01-29 14:35:00.805: E/AndroidRuntime(25696): Process: com.ihi.bcr, PID: 25696
01-29 14:35:00.805: E/AndroidRuntime(25696): java.lang.RuntimeException: Unable to start service com.ihi.bcr.services.ContactSyncService#44e4fbf8 with Intent { flg=0x10000000 cmp=com.ihi.bcr/.services.ContactSyncService }: java.lang.NullPointerException
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2719)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.ActivityThread.access$2100(ActivityThread.java:135)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.os.Handler.dispatchMessage(Handler.java:102)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.os.Looper.loop(Looper.java:136)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.ActivityThread.main(ActivityThread.java:5017)
01-29 14:35:00.805: E/AndroidRuntime(25696): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 14:35:00.805: E/AndroidRuntime(25696): at java.lang.reflect.Method.invoke(Method.java:515)
01-29 14:35:00.805: E/AndroidRuntime(25696): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
01-29 14:35:00.805: E/AndroidRuntime(25696): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
01-29 14:35:00.805: E/AndroidRuntime(25696): at dalvik.system.NativeStart.main(Native Method)
01-29 14:35:00.805: E/AndroidRuntime(25696): Caused by: java.lang.NullPointerException
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.IntentService.onStart(IntentService.java:116)
01-29 14:35:00.805: E/AndroidRuntime(25696): at roboguice.service.RoboIntentService.onStart(RoboIntentService.java:66)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.IntentService.onStartCommand(IntentService.java:130)
01-29 14:35:00.805: E/AndroidRuntime(25696): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2702)
01-29 14:35:00.805: E/AndroidRuntime(25696): ... 10 more
01-29 14:35:00.815: W/ActivityManager(780): Force finishing activity com.ihi.bcr/.activity.HomeScreen
01-29 14:35:00.975: E/Database(19015): 0
01-29 14:35:01.185: E/Database(19015): 0
01-29 14:35:01.215: D/audio_hw_primary(184): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
01-29 14:35:01.345: W/ActivityManager(780): Activity pause timeout for ActivityRecord{4382e1c0 u0 com.ihi.bcr/.activity.HomeScreen t171 f}
01-29 14:35:01.405: E/Database(19015): 0
01-29 14:35:01.645: D/dalvikvm(19015): GC_FOR_ALLOC freed 527K, 4% free 17113K/17728K, paused 24ms, total 25ms
NOTE:
ContactSyncService is intent service.
I am starting contactSyncService by startService() method.
I didn't override onStart and onStartCommand() functions of IntentService(As it is mention in Android Docs)

You have missed to call super.onCreate() in your ContactSyncService.onCreate().

Related

How to diplay image from firebase using only its name

FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference gsReference = storage.getReferenceFromUrl("gs://bacpoche-5ecb0.appspot.com/natio/agr-svt-2009-6-cr.jpg");
Glide.with(this )
.using(new FirebaseImageLoader())
.load(gsReference)
.into(t);
But it shows "Unfortunately YourApp has stopped".
I already have internet permission in manifest file. Below is the Error
The moniteur//E/
AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aitelred.redouane.tstv7/com.aitelred.redouane.tstv7.MainActivity}: java.lang.IllegalArgumentException: The supplied bucketname is not available to this project.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
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.IllegalArgumentException: The supplied bucketname is not available to this project.
at com.google.android.gms.common.internal.zzac.zzb(Unknown Source)
at com.google.firebase.storage.FirebaseStorage.zzz(Unknown Source)
at com.google.firebase.storage.FirebaseStorage.getReferenceFromUrl(Unknown Source)
at com.aitelred.redouane.tstv7.MainActivity.onCreate(MainActivity.java:49)
at android.app.Activity.performCreate(Activity.java:4466)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
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)

AVD crashes saying 'Unfortunately, libcocos2dx has crashed'

I just loaded my app created by cocos2dx-3.10 and when I open with it an AVD (again I haven't done any modifications to the app) the app crashes and gives the error: Unfortunately, libcocos2dx has crashed.
here is what I get in my android Monitor:
03-05 18:34:56.668 1435-1435/? D/dalvikvm: Not late-enabling CheckJNI (already on)
03-05 18:34:56.989 1435-1435/com.trying.name E/Trace: error opening trace file: No such file or directory (2)
03-05 18:34:57.419 1435-1435/com.trying.name D/AndroidRuntime: Shutting down VM
03-05 18:34:57.419 1435-1435/com.trying.name W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb2f2b288)
03-05 18:34:57.518 1435-1435/com.trying.name E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:263)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
03-05 18:35:11.559 1435-1435/? I/Process: Sending signal. PID: 1435 SIG: 9

Cannot use android.support.v7.widget.DrawerLayout in Android

I am absolute beginner to Android. I start learning how to use action bar in android very well with navigation drawer. I already created a simple app using android.support.v4.widget.DrawerLayout layout in xml file.
It was working fine. But when I use android.support.v7.widget.DrawerLayout instead, it is throwing error. But when I changed it back to android.support.v4.widget.DrawerLayout,it is working fine.
This is my activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- This LinearLayout represents the contents of the screen -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- The ActionBar displayed at the top -->
<include
layout="#layout/action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- The main content view where fragments are loaded -->
<FrameLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- The navigation drawer that comes from the left -->
<!-- Note that `android:layout_gravity` needs to be set to 'start' -->
<android.support.design.widget.NavigationView
android:id="#+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#android:color/white"/>
<!--app:headerLayout="#layout/nav_header"
app:menu="#menu/drawer_view" />-->
</android.support.v7.widget.DrawerLayout>
This is the action_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
</android.support.v7.widget.Toolbar>
This is my MainActivity.java
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
This is the errors in logcat when I run it
01-29 11:22:43.026 20642-20642/? D/dalvikvm: Late-enabling CheckJNI
01-29 11:22:43.118 20642-20642/com.blog.waiyanhein.llks.llks W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks W/dalvikvm: VFY: unable to resolve interface method 17962: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks W/dalvikvm: VFY: unable to resolve interface method 17966: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
01-29 11:22:43.122 20642-20642/com.blog.waiyanhein.llks.llks D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
01-29 11:22:43.190 20642-20642/com.blog.waiyanhein.llks.llks D/AndroidRuntime: Shutting down VM
01-29 11:22:43.190 20642-20642/com.blog.waiyanhein.llks.llks W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa617d908)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: FATAL EXCEPTION: main
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.blog.waiyanhein.llks.llks/com.blog.waiyanhein.llks.llks.MainActivity}: android.view.InflateException: Binary XML file line #3: Error inflating class android.support.v7.widget.DrawerLayout
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5041)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class android.support.v7.widget.DrawerLayout
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.blog.waiyanhein.llks.llks.MainActivity.onCreate(MainActivity.java:15)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5104)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5041) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.DrawerLayout" on path: /data/app/com.blog.waiyanhein.llks.llks-2.apk
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:552)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:466) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.blog.waiyanhein.llks.llks.MainActivity.onCreate(MainActivity.java:15) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5104) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5041) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
01-29 11:22:43.210 20642-20642/com.blog.waiyanhein.llks.llks E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 
What is wrong with my code?
You're getting a ClassNotFoundException because there is no DrawerLayout class in the v7 appcompat library.
They did not update this particular widget, presumably because there wasn't really anything to improve upon functionally, nor anything visual that needed a makeover, as it's just an empty, transparent layout.
Other components that were updated - such as the ActionBarDrawerToggle class - are designed to work with the v4 support library version of DrawerLayout, and, in fact, the v7 library depends on the v4.
TL;DR - Just stick with the v4 DrawerLayout.
Instead of using v7 use v4. Change the
android.support.v7.widget.DrawerLayout
to
android.support.v4.widget.DrawerLayout
Will solve the issue.

Exception dispatching input event, while calling startActivity

There are several related question already asked on StackOverflow and other forums. But, still this is causing and none of the solution is working for me. Also, I would like to state that I am using device 13'3 inch Braun Tablet.
Flow of application as per Activity,
A Activity calling B Activity and from B I am calling A Activity with flag FLAG_ACTIVITY_CLEAR_TOP and there after process is repeated for Activities from Activity A to Activity B. Below is more detailed explanation
I am calling my MainActivity from a dialog for updating database as below,
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(context.getString(R.string.IS_UPDATE_DATA), true);
context.startActivity(intent);
And after that I am updating my database from a web-service call using AsyncTask and on completion of update I am using below code to startActivity from onTouch() of Activity,
Intent intent = new Intent(mContext, CategoryActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
This is causing below crash everytime,
01-29 20:21:44.631: E/InputEventReceiver(3213): Exception dispatching input event.
01-29 20:21:44.631: E/MessageQueue-JNI(3213): Exception in MessageQueue callback: handleReceiveCallback
01-29 20:21:44.651: E/MessageQueue-JNI(3213): java.lang.NullPointerException
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.os.Parcel.readException(Parcel.java:1431)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.os.Parcel.readException(Parcel.java:1379)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1892)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1412)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Activity.startActivityForResult(Activity.java:3407)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Activity.startActivityForResult(Activity.java:3368)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:839)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Activity.startActivity(Activity.java:3603)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Activity.startActivity(Activity.java:3571)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.brodos.app.storeship.MainActivity.onTouch(MainActivity.java:857)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.View.dispatchTouchEvent(View.java:7258)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1878)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1878)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1878)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2177)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1878)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2470)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1633)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.Activity.dispatchTouchEvent(Activity.java:2428)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2418)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.View.dispatchPointerEvent(View.java:7443)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchPointerEvent(PhoneWindow.java:2323)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3526)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3471)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4612)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4591)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4683)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.os.MessageQueue.nativePollOnce(Native Method)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.os.MessageQueue.next(MessageQueue.java:125)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.os.Looper.loop(Looper.java:124)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at android.app.ActivityThread.main(ActivityThread.java:5063)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at java.lang.reflect.Method.invoke(Method.java:511)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-29 20:21:44.651: E/MessageQueue-JNI(3213): at dalvik.system.NativeStart.main(Native Method)
Let me know if anyone can guide or has a solution for it. Also, let me know if anything is missing in question to be added.
I have been through a quite similar to yours, and the solution has been like this:
if (savedInstanceState != null) {
Intent mIntent = new Intent(context, SomeActivity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(mIntent);
mIntent.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
}
As you are running a AsyncTask, I think you need to start your activity in onPostExecute() method of AsyncTask().

Android Quickblox Video chat error

I am developing a video chat application for android using Quickblox library. But I am getting some errors while maintaining video chat session. When user gets logged in as receiver (second user) then app gets crashes after some time giving folowing log output.
01-28 18:23:20.149: W/System.err(15082): at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.149: W/System.err(15082): at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.149: W/System.err(15082): at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.149: W/System.err(15082): at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.149: W/System.err(15082): at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudioSenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.149: W/System.err(15082): at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.159: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.159: W/System.err(15082): ... 12 more
01-28 18:23:20.199: W/AudioTrack(15082): obtainBuffer() track 0x7e5788 disabled, restarting
01-28 18:23:20.219: W/ilbc-codec(15082): Ignore last 0 bytes
01-28 18:23:20.349: W/System.err(15082): java.net.SocketException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.359: W/System.err(15082): at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:496)
01-28 18:23:20.359: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:465)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.359: W/System.err(15082): at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.359: W/System.err(15082): at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.359: W/System.err(15082): at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudioSenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.359: W/System.err(15082): at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.359: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.379: W/System.err(15082): ... 12 more
sometimes it gives AdioRecord error
java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
Anyone have any idea about this or have any other library for chat application integration ?
Thanks
EDIT
Here are some more errors,
01-29 16:38:58.831: E/AndroidRuntime(6775): FATAL EXCEPTION: Thread-3039
01-29 16:38:58.831: E/AndroidRuntime(6775): java.lang.ExceptionInInitializerError
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.run(AudioRecorder.java:123)
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.Thread.run(Thread.java:856)
01-29 16:38:58.831: E/AndroidRuntime(6775): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load ilbc-codec: findLibrary returned null
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.System.loadLibrary(System.java:535)
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.googlecode.androidilbc.Codec.<init>(Codec.java:16)
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.googlecode.androidilbc.Codec.<clinit>(Codec.java:5)
01-29 16:38:58.831: E/AndroidRuntime(6775): ... 2 more
01-29 11:01:15.772: E/AndroidRuntime(18705): FATAL EXCEPTION: main
01-29 11:01:15.772: E/AndroidRuntime(18705): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rechargedoctor.android.app/com.quickblox.videochatsample.ui.ActivityVideoChat}: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1959)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1984)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.access$600(ActivityThread.java:126)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.os.Handler.dispatchMessage(Handler.java:99)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.os.Looper.loop(Looper.java:137)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.main(ActivityThread.java:4456)
01-29 11:01:15.772: E/AndroidRuntime(18705): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705): at java.lang.reflect.Method.invoke(Method.java:511)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
01-29 11:01:15.772: E/AndroidRuntime(18705): at dalvik.system.NativeStart.main(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705): Caused by: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.media.AudioRecord.startRecording(AudioRecord.java:534)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.initRecorder(AudioRecorder.java:97)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.<init>(AudioRecorder.java:75)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder.startAudioRecorder(AudioRecorder.java:31)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.service.QBVideoChatService.startVideoChat(QBVideoChatService.java:93)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.videochatsample.ui.ActivityVideoChat.initViews(ActivityVideoChat.java:69)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.videochatsample.ui.ActivityVideoChat.onCreate(ActivityVideoChat.java:40)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.Activity.performCreate(Activity.java:4465)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1923)
01-29 11:01:15.772: E/AndroidRuntime(18705): ... 11 more
just copy the libs/armeabi/libilbc-codec file from the Sample-VideoChat-android project to your new project. everything should work fine.
First of all, check, if you copied native library to your project. Than, if you get other errors, try not copy sources of examples into your project, but try to load and run sources of video chat samples, which you can find here https://github.com/QuickBlox/Sample-VideoChat-android

Categories

Resources