App crashes when trying to extend SherlockActivity in android studio - android

After importing the actionbarsherlock module, my app crashes on any activity that extends the SherlockActivity. I am not sure if I had imported it incorrectly or something needs to be adjusted but I have followed a guide that was previously posted here on stackoverflow. If i extend Activity and not sherlockActivity there will be no crash.
Guide https://stackoverflow.com/a/16591272/1671933
Logcat
05-24 08:41:46.072 1241-1241/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.example.sandbox.TestingCam
at com.example.sandbox.LoginActivity$CheckLogin.onPostExecute(LoginActivity.java:204)
at com.example.sandbox.LoginActivity$CheckLogin.onPostExecute(LoginActivity.java:155)
at android.os.AsyncTask.finish(AsyncTask.java:417)
at android.os.AsyncTask.access$300(AsyncTask.java:127)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

You need to make sure that the dependency scope is set to "compile". In some cases it seem to be set to "provided" which will cause a NoClassDefFoundError.

Related

Firebase Analytics - NPE in CrashReport

I've just migrated to Firebase Analytics 9.0.0 and when tried to launch the app on emulator api10/x86, then the following exception is thrown by the services. Any ideas how to work around that?
05-23 15:36:44.371 1280-1280/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.szyk.myheart/com.szyk.myheart.MyHeartActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.google.android.gms.flags.impl.FlagProviderImpl.getBooleanFlagValue(Unknown Source)
at com.google.android.gms.internal.zzsd$zza.zzb(Unknown Source)
at com.google.android.gms.internal.zzsd$zza.zza(Unknown Source)
at com.google.android.gms.internal.zzsf.zzb(Unknown Source)
at com.google.android.gms.internal.zzsd.get(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.zzOW(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.log(Unknown Source)
at com.szyk.extras.activities.UniversalActionBarActivity.onCreate(UniversalActionBarActivity.java:46)
at com.szyk.myheart.MyHeartActivity.onCreate(MyHeartActivity.java:99)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
The code is nothing more than activity with:
#Override
protected void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FirebaseCrash.log("onCreate: " + getClass().getSimpleName());
}
Unfortunately, using Firebase on devices or emulators without Play Services isn't a supported use case. Crash Reporting will fail to initialize, and you will see a message to that effect in logcat when the app launches. However, if you are also seeing a crash when calling a method after failed init, that seems like a problem we should correct.
It sounds like you are doing the best thing you can by suppressing the exception, but I'd rather not make you go through that, so I'll pass it on as feedback to the team.
Just small correction on what Doug mentioned. Firebase Crash Reporting is not supported on non-play devices. Firebase Analytics in particular and some of the other Firebase product do support non-play devices.

java.lang.NoClassDefFoundError when calling DolbyAudioProcessing.getDolbyAudioProcessing

I have integrated Dolby_audio_plugin_api_v1.1.1.0 into my Android app and am seeing this stack trace in a handful of cases:
java.lang.NoClassDefFoundError: com.dolby.dap.DsClientManager$AppActivityLifecycleCallbacks
at com.dolby.dap.DsClientManager.(DsClientManager.java:196)
at com.dolby.dap.DolbyAudioProcessing.(DolbyAudioProcessing.java:143)
at
com.dolby.dap.DolbyAudioProcessing.getDolbyAudioProcessing(DolbyAudioProcessing.java:125)
at com.houseofhighfives.saddest_trombone.Main.onCreate(Main.java:44)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(NativeStart.java)
Following the examples on the Dolby dev site, this is the call that tries to initialize the DolbyAudioProcessing instance:
mDolbyAudioProcessing = DolbyAudioProcessing.getDolbyAudioProcessing(this, PROFILE.MUSIC, this);
According to Crashlytics, all instances were on a Samsung GT-S5360B or GT-S5360L, running Android 2.3.6.
Very minor thing, given how infrequent it is, but it makes me curious. Has anyone else seen this before?
So this turned out to be a because the AppActivityLifecycleCallbacks is an ICS API Level interface. I should have been doing SDK_LEVEL check before calling DolbyAudioProcessing.getDolbyAudioProcessing(). – mmcmahon

java.lang.NoSuchMethodError - ErrorActivity.onCreate()

I am new to android apps development, and for somehow I am getting errors in my playgoogle apps account.
can anyone explain which kind of error is this?
java.lang.NoSuchMethodError: dk.danyal.kids.channel.ErrorActivity.getActionBar
at dk.danyal.kids.channel.ErrorActivity.onCreate(ErrorActivity.java:19)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1670)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3695)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Probably your application is for Android 3.0 or higher and you are running it on Android 2.x
Your Project should target Android version 3.0 or above to use getActionBar() function.
To have the ActionBar in older versions of Android, you can have a look at ActionBarSherlock (http://actionbarsherlock.com/). It uses the ActionBar when it is available, and falls back on a custom implementation if it isn't available.

AdWhirl with Admob bug fix

Updated to the latest version of AdWhirl and AdMob SDK but getting a known error from the AdMob SDK in Android 2.1-update1. Found in this thread https://groups.google.com/forum/#!topic/google-admob-ads-sdk/cNxRgIUHJH0
but it refers to only and AdMob fix not AdWhirl any clue what changes can be made to the AdWhirl SDK to fix this?
Thanks In Advance!
java.lang.NullPointerException
at android.webkit.WebView.getSettings(WebView.java:2791)
at android.webkit.WebView.onWindowFocusChanged(WebView.java:3616)
at android.view.View.dispatchWindowFocusChanged(View.java:3764)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:754)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:758)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4370)
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:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
How about this one:
java.lang.NullPointerException
at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:227)
at com.adwhirl.AdWhirlLayout.access$3(AdWhirlLayout.java:215)
at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:410)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
at dalvik.system.NativeStart.main(Native Method)
The issue is not in the AdWhirl code, or even the AdMob code. This is a NullPointerException in the Android WebView, and there is no known workaround for the AdMob/AdWhirl code. This shouldn't be happening that often, but if it really is a deal breaker, you may want to turn down the number of requests you're sending to AdMob.
Yes, I also have this problem.
My workaround: extend AdWhirlLayout, override dispatchWindowFocusChanged and every other method that have this exception occurring and catch the exception.

NullPointerException in com.reg.project

I have no Idea why I get this error :/
Exception class java.lang.NullPointerException
Source method Jax$7.onClick()
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9089)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Obviously you are dereferencing a variable in line 83 of the file Jax.java where the variable is null.
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
If show the relevant code, people may be able to help you.

Categories

Resources