I'm using a third party library, there is a method using DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);. When I test my app in android 5.0+,there was no problem and worked well.But when it came to android 4.4.4, it threw an Exception:
05-09 13:15:15.030 26447-26447/com.wizchen.athit E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wizchen.athit, PID: 26447
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wizchen.athit/com.wizchen.athit.view.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2320)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5117)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.support.v4.graphics.drawable.DrawableWrapperDonut.setCompatTintMode(DrawableWrapperDonut.java:278)
at android.support.v4.graphics.drawable.DrawableCompatBase.setTintMode(DrawableCompatBase.java:48)
at android.support.v4.graphics.drawable.DrawableCompat$BaseDrawableImpl.setTintMode(DrawableCompat.java:99)
at android.support.v4.graphics.drawable.DrawableCompat.setTintMode(DrawableCompat.java:400)
at com.wizchen.athit.lib.AppThemeEngine.util.TintHelper.createTintedDrawable(TintHelper.java:359)
at com.wizchen.athit.lib.AppThemeEngine.viewprocessors.ToolbarProcessor.process(ToolbarProcessor.java:117)
at com.wizchen.athit.lib.AppThemeEngine.viewprocessors.ToolbarProcessor.process(ToolbarProcessor.java:44)
at com.wizchen.athit.lib.AppThemeEngine.ATE.postApply(ATE.java:209)
at com.wizchen.athit.lib.AppThemeEngine.ATEActivity.onStart(ATEActivity.java:60)
at com.wizchen.athit.view.activity.MainActivity.onStart(MainActivity.java:68)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1183)
at android.app.Activity.performStart(Activity.java:5359)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2244)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2320)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5117)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Except the stack trace above, I saw some error info printed in my console like this:
05-09 13:15:15.030 26447-26447/com.wizchen.athit E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method com.wizchen.athit.lib.AppThemeEngine.util.TintHelper.setTintAuto
And this one:
05-09 13:15:15.030 26447-26447/com.wizchen.athit E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method com.wizchen.athit.lib.AppThemeEngine.util.TintHelper.setTintSelector
Of course I have compiled the v4 support library in my project :)
Who have encountered this problem? Thanks for help!
------------------------------------------------------------------------------------------
Update 1:
this is what causes NullPointerException:
#CheckResult
#Nullable
public static Drawable createTintedDrawable(#Nullable Drawable drawable, #ColorInt int color) {
if (drawable == null) return null;
drawable = DrawableCompat.wrap(drawable.mutate());
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
DrawableCompat.setTint(drawable, color);
return drawable;
}
Read this :
If you look at the source code for DrawableCompat you will see that for any version < support library 21 the method does nothing.
The idea of DrawableCompat seems to be simply not crashing on old versions, rather than actually providing that functionality.
UseFul Tips :
With support library 22.1 you can use DrawableCompat to tint drawables.
DrawableCompat.wrap(Drawable) and setTint(), setTintList(), and
setTintMode() will just work: no need to create and maintain separate
drawables only to support multiple colors!
i used ?colorPrimary for creating button background and its sake error in my project , and i change ?colorPrimary to #color/colorPrimary and its work for me :)
Related
I'm getting the following error immediately on launch, but only for devices running API <20.
**edit: I initially reported this in Android Studio 2.4, and it's still an issue in Android Studio 3.0 stable
D/dalvikvm: Trying to load lib /mnt/asec/[[packagename]]-1/lib/libsupportjni.so 0x41b13f30
E/dalvikvm: dlopen("/mnt/asec/[[packagename]]-1/lib/libsupportjni.so") failed: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/android/tools/profiler/support/ProfilerService;
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41659ce0)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: [[packagename]], PID: 7500
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at com.android.tools.profiler.support.ProfilerService.<clinit>(ProfilerService.java:44)
at [[packagename]].App.<init>(App.kt:25)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newApplication(Instrumentation.java:990)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4446)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Go to Run -> Edit Configurations -> Profiling, and disable "Enable advanced profiling". This feature is not currently compatible with API <20, and will cause this or similar crashes. This may be fixed in the future, but as of Android Studio 2.4 preview 7, it's an open issue. Related issue
I'm getting a Resources$notfoundexception on older (pre-L) devices. I'm including the full stacktrace below.
My version of the support library is the latest (24.1.0), and I've included in my gradle file the line:
vectorDrawables.useSupportLibrary = true
My base theme is a noactionbar theme - "Theme.AppCompat.Light.NoActionBar"
The crash is happening on this line in my code where I reference the back arrow in a support-toolbar in order to later change it's color:
#SuppressLint("PrivateResource") final Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.abc_ic_ab_back_material);
What could be the cause of this? This code works fine for all users with L or above.
07-19 22:36:57.029 9330-9330/mypkg E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {mypkg/mypkg.activites.myActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2619)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4929)
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:798)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
at android.content.res.Resources.loadDrawable(Resources.java:1957)
at android.content.res.Resources.getDrawable(Resources.java:673)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:354)
at mypkg.base.mymethod(myactivity.java:100)
at mypkg.mymethod(myactivity.java:100)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:511)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:178)
at android.app.Activity.performResume(Activity.java:5341)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4929)
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:798)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)
at android.content.res.Resources.loadDrawable(Resources.java:1954)
at android.content.res.Resources.getDrawable(Resources.java:673)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:354)
at mypkg/mymethod(myactivity.java:100)
at mypkg/mymethod(myactivity.java:100)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:511)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:178)
at android.app.Activity.performResume(Activity.java:5341)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4929)
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:798)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
The answer to this turned out to be buried at the bottom of this guide:
https://medium.com/#chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.xucjbsts0
It turns out that all you need to add this line in at the beginning of the activity that will use the resource:
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
Please make sure you are using AppCompatActivity instead Activity. If you're using AppCompat's theme, then you also need to use it's Activity.
Another solution,
in addition to AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
is to wrap your vector drawable into another drawable:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/ic_your_vector"/>
</selector>
Might be useful when you use as a drawable for a TextView (i.e. DrawableLeft)
Accepted answer is not covered all cases. It will not work on Android 4.0.3/4.1.1/4.1.2 platform with 25.x.x support library. The right way to fix problem with abc_ic_ab_back_material.xml is to override homeAsUpIndicator attribute in your theme. For example, my theme is inherited from Theme.AppCompat.Light.NoActionBar. As for value of mentioned attribute, you can use #drawable/abc_ic_ab_back_mtrl_am_alpha or your custom 'back' drawable.
private resources its treated differently at compile time and runtime..to fix I usually take the offending private resource and backport it to my app in my res files
I was using the application context when calling ContextCompat.getDrawable() which also crashes the app with Resources$NotFoundException and now the following message even though everything else was set up just fine:
If the resource you are trying to use is a vector resource, you may be
referencing it in an unsupported way. See
AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.
All I had to do was to change to the view's Context. :)
Instead of:
ContextCompat.getdrawable()
Try using:
AppCompatDrawableManager.get().getDrawable()
I recently updated my Song Scrapbook app to the latest version and also made sure to update all third-party APIs used by the app. One such third-party tool is the PayPal Android SDK which I use to monetize my app since I live in a country where the Google Wallet Merchant service is currently not supported - which means I cannot use the Play Store in-app or once-off purchase systems in my app.
However, after updating the PayPal SDK to the latest version in my app (via mavenCentral) I get the following error in Android Studio (version: 1.5.1) everytime I want to execute a PayPal transaction:
debug W/paypal.sdk: PayPalService created. API:19 PayPalSDK/PayPal-Android-SDK 2.13.3 (Android 4.4.4; samsung GT-I9060I; )
03-20 16:58:45.540 7804-7804/com.whitsoft.songscrapbook.debug W/ApplicationPackageManager: getCSCPackageItemText()
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug W/ApplicationPackageManager: getCSCPackageItemText()
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug I/dalvikvm: Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method com.paypal.android.sdk.at.a
03-20 16:58:45.550 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: VFY: unable to resolve static method 10405: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
03-20 16:58:45.610 7804-7804/com.whitsoft.songscrapbook.debug I/dalvikvm: Could not find method io.card.payment.CardIOActivity.checkSelfPermission, referenced from method io.card.payment.CardIOActivity.onCreate
03-20 16:58:45.610 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: VFY: unable to resolve virtual method 13172: Lio/card/payment/CardIOActivity;.checkSelfPermission (Ljava/lang/String;)I
03-20 16:58:45.820 7804-7843/com.whitsoft.songscrapbook.debug I/System: Loaded time zone names for "en" in 132ms (127ms in ICU)
03-20 16:58:45.840 7804-7804/com.whitsoft.songscrapbook.debug W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4168cbc0)
03-20 16:58:45.840 7804-7804/com.whitsoft.songscrapbook.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.whitsoft.songscrapbook.debug, PID: 7804
java.lang.RuntimeException: Unable to start service com.paypal.android.sdk.payments.PayPalService#41e9c5a0 with Intent { cmp=com.whitsoft.songscrapbook.debug/com.paypal.android.sdk.payments.PayPalService (has extras) }: java.lang.IllegalStateException: Unable to extract the trust manager on a.a.k#41ff61a0, sslSocketFactory is class com.paypal.android.sdk.bn
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2987)
at android.app.ActivityThread.access$2100(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on a.a.k#41ff61a0, sslSocketFactory is class com.paypal.android.sdk.bn
at a.ak.<init>(Unknown Source)
at a.ak.<init>(Unknown Source)
at a.am.b(Unknown Source)
at com.paypal.android.sdk.bt.<init>(Unknown Source)
at com.paypal.android.sdk.payments.PayPalService.a(Unknown Source)
at com.paypal.android.sdk.payments.PayPalService.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2970)
at android.app.ActivityThread.access$2100(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
03-20 17:03:46.103 7804-7804/? I/Process: Sending signal. PID: 7804 SIG: 9
I know this problem is not caused by the device on which I tested the app - as I have tested this app on two very different devices (Samsung Grand Neo and Cubot X15) and both devices produced similar errors. I tried googling the problem to try and solve the problem but after hours of searching found no solution.
Any assistance will be much appreciated.
SilSur.
So it took me roughly 5 hours to figure this one out - which I achieved through a step-by-step elimination of possible causes of the problem.
Turns out the real problem was my haste in trying to update the app. The reason being that the PayPal SDK 2.13.3 version has a new rule in the 'proguard-rules.pro' file that is very important to include:
Rule as follows:
# This is added for okhttp 3.1.2 bug fix as shown at https://github.com/square/okhttp/issues/2323
-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
private javax.net.ssl.SSLSocketFactory delegate;
}
This prevents the minify (obfuscation) process of Gradle from removing IMPORTANT code from a previous bug-fix in the PayPal SDK that caused problems with the secure layer socket factory. So yeah - that was the fix: the updated app now works perfectly (just as required).
Lesson learnt: make sure your 'proguard-rules' are exactly as they are suppose to be!
Over & Out, SilSur.
I find a good external lib to implement many beautiful Textview animations. The link is this: https://github.com/daimajia/AndroidViewAnimations
I have a problem to implement it. I have imported correctly all 3 libs and I use correctly the function like in the dev's example:
YoYo.with(Techniques.Tada).duration(700).playOn(findViewById(R.id.TextView1));
Eclipse doesn't segnalate me any problem. But when I launch the application, it crashes
p.s. sorry for my bad english, I'm italian :(
EDIT 1:
logcat:
FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.app.ActivityThread.main(ActivityThread.java:4960)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
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:3675)
... 12 more
Caused by: java.lang.NoClassDefFoundError:com.daimajia.androidanimations.library.Techniques
enter code here
I had the same problem. My problem was missing dependency AndroidEasingFunctions-1.0.0. Please make sure all dependencies are included into the project correctly. See https://github.com/daimajia/AndroidViewAnimations.
I just added GMS to my app to use the LocationClient and now my app is crashing upon startup. Looks like my main activity can no longer find my service which is where the location logic is handled.
I added the below line to my gradle dependencies in order to pull in gms.
compile 'com.google.android.gms:play-services:4.0.30'
This is the error I am getting.
28 22:10:39.761 2885-2885/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.nathan.allgood, PID: 2885
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/myname/appname/services/ActivityService;
Also have this in my manifest:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Any Ideas?
Thanks,
Nathan
EDIT: Added LogCat and Method where error happens
/**
* Bind this Activity to MyService
*/
private void doBindService() {
getActivity().bindService(new Intent(getActivity(), ActivityService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
}
11-28 22:53:59.502 2278-2278/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.myname.appname, PID: 2278
java.lang.NoClassDefFoundError: com.myname.appname.services.ActivityService
at com.myname.appname.Activity1$OneFragment.automaticBind(Activity1.java:119)
at com.myname.appname.Activity1$OneFragment.onResume(Activity1.java:105)
at android.app.Fragment.performResume(Fragment.java:1743)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:924)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1863)
at android.app.Activity.performResume(Activity.java:5332)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2779)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2818)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.access$700(ActivityThread.java:145)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5062)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
11-28 23:33:12.336 6335-6335/com.myname.appname E/dalvikvm﹕ Could not find class 'com.myname.appname.services.ActivityService', referenced from method com.myname.appname.Activity1$OneFragment.doBindService
11-28 23:33:12.386 6335-6335/com.myname.appname E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.myname.appname, PID: 6335
java.lang.NoClassDefFoundError: com.myname.appname.services.ActivityService
at com.myname.appname.Activity1$OneFragment.automaticBind(Activity1.java:119)
at com.myname.appname.Activity1$OneFragment.onResume(Activity1.java:105)
at android.app.Fragment.performResume(Fragment.java:1743)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:924)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1863)
at android.app.Activity.performResume(Activity.java:5332)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2779)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2818)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.access$700(ActivityThread.java:145)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5062)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Edit 2:
I should also mention I am using Android Studio
SOLUTION!!!
Edit 3:
Following some advice from another stackoverflow post I did a
gradlew clean and then gradlew build which seems to have fixed the problem!
Because you have not post your code, look for "Caused by" in your logcat. Tell me why you use AsyncTask to get your Location?