Android Studio seems to build old version of project - android

I am wondering if this is some bug in Android Studio or I am simply lack od knowladge but straight to the point.
I am writing simple client-server via bluetooth app on android. At some point I encoured following problem:
07-11 18:59:20.553 10364-10364/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not find a method parujUrzadzenia(View) in the activity class com.example.pc.klient_serwerbluetooth.Klient for onClick handler on view class android.widget.Button with id 'button6'
at android.view.View$1.onClick(View.java:3775)
at android.view.View.performClick(View.java:4421)
at android.view.View$PerformClick.run(View.java:18190)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoSuchMethodException: parujUrzadzenia [class android.view.View]
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getMethod(Class.java:915)
at android.view.View$1.onClick(View.java:3768)
at android.view.View.performClick(View.java:4421)
at android.view.View$PerformClick.run(View.java:18190)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
07-11 19:34:00.498 449-522/? E/ActivityManager﹕ The package com.example.pc.klient_serwerbluetooth is not found. Failure starting process com.example.pc.klient_serwerbluetooth
For what I understand Android Studio can't find method parujUrzadzenia(View) that is marked in button6's properties as onClick method...the funny thing is i deleted this button in my way of solving this problem.
I can't post picture of my project due to low reputation but like I said. I've deleted the reference to method from .xml and method from .java file and got an error saying that there is no required onClick method. So I deleted this whole button and still got this error.
Any advices will be greatly appreciated.

Related

Android crash: Failed to initialize display event receiver

my application crashed when I start it again after closing it for quite some time. Below you can see the log that shows the error:
java.lang.RuntimeException: Failed to initialize display event receiver. status=-2147483648
at android.view.DisplayEventReceiver.nativeInit(Native Method)
at android.view.DisplayEventReceiver.<init>(DisplayEventReceiver.java:61)
at android.view.Choreographer$FrameDisplayEventReceiver.<init>(Choreographer.java:725)
at android.view.Choreographer.<init>(Choreographer.java:169)
at android.view.Choreographer.<init>(Choreographer.java:69)
at android.view.Choreographer$1.initialValue(Choreographer.java:95)
at android.view.Choreographer$1.initialValue(Choreographer.java:88)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.view.Choreographer.getInstance(Choreographer.java:194)
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:487)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:235)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2892)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2304)
at android.app.ActivityThread.access$700(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
I'm looking for the solution or at least someone with similar problem but surprisingly there is none.
Someone can help me?
Thank you!

Android voice recording crashes (straight from Docs)

I've taken the code from Android's own Audio Capture documentation and ran it to achieve just what the docs say. As is, the code crashes when I click the "Start Recording" button and the crash says the following:
FATAL EXCEPTION: main
java.lang.IllegalStateException
at android.media.MediaRecorder.start(Native Method)
**at com.om.shout_o_meter.MainActivity.startRecording(MainActivity.java:130)
at com.om.shout_o_meter.MainActivity.onRecord(MainActivity.java:111)
at com.om.shout_o_meter.MainActivity.access$0(MainActivity.java:109)
at com.om.shout_o_meter.MainActivity$1.onClick(MainActivity.java:38)
at android.view.View.performClick(View.java:4211)
at android.view.View$PerformClick.run(View.java:17267)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
If I place AudioRecordTest() at the very beginning of the startRecording() method, the crash ceases until I finish the first recording and then press "Start Recording" again, the crash reappears with the following message:
FATAL EXCEPTION: main
java.lang.NullPointerException
at com.om.shout_o_meter.MainActivity.stopRecording(MainActivity.java:135)
at com.om.shout_o_meter.MainActivity.onRecord(MainActivity.java:113)
at com.om.shout_o_meter.MainActivity.access$0(MainActivity.java:109)
at com.om.shout_o_meter.MainActivity$1.onClick(MainActivity.java:38)
at android.view.View.performClick(View.java:4211)
at android.view.View$PerformClick.run(View.java:17267)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
The code I'm using is the exact same code as that of the docs (linked above), and the "MainActivity" file that the exception is pointing to can be found here: http://pastie.org/8682455
Any clue? what baffles me is that the code is pasted as is, straight from the docs, and still it fails..
Thanks

Having issues integrating Scandit SDK into my app

Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>

android looking for onClick handler in ContextThemeWrapper

In 4.0.3 if i am using a base theme in my manifest, it appears to Android is trying to resolve my onClick methods of my menu's in the android.view.ContextThemeWrapper class. It resolves fine in 4.03+. I can take out the style in the manifest and everything works and gets resolved. How can I get the onClick methods to resolve correctly while using a theme?
I'm inflating the menu in the onCreateOptionsMenue() method and that's where the exception is getting thrown.
android.view.InflateException: Couldn't resolve menu item onClick
handler createNewDoc in class android.view.ContextThemeWrapper
at android.view.MenuInflater$InflatedOnMenuItemClickListener.(MenuInflater.java:202)
at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:402)
at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:436)
at android.view.MenuInflater.parseMenu(MenuInflater.java:173)
at android.view.MenuInflater.inflate(MenuInflater.java:95)
at com.c2crm.c2crm.ListActivity.onCreateOptionsMenu(ListActivity.java:326)
at android.app.Activity.onCreatePanelMenu(Activity.java:2444)
at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:388)
at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:739)
at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:2833)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
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.NoSuchMethodException: createNewDoc [interface android.view.MenuItem]
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getMethod(Class.java:915)
at android.view.MenuInflater$InflatedOnMenuItemClickListener.(MenuInflater.java:200)

NullPointer exception at android.support.v4.app.FragmentManagerImpl.makeInactive

I'm seeing a weird exception in Android Support Library - the stack trace is below. Any ideas what could be causing this? I'm unable to reproduce the exception on any of my devices, but there seem to be quite a few visible in the Google Play DevConsole.
java.lang.NullPointerException
at android.support.v4.app.FragmentManagerImpl.makeInactive(FragmentManager.java:1133)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
at android.support.v4.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1171)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:582)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:420)
at android.os.Handler.handleCallback(Handler.java:608)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:5045)
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)
try check stack fragments in time rotate screen for example in onResume.

Categories

Resources