Everytime I run the app, I get this error message. There is nothing in the app, it is just a basic Navigation drawer template you get in the studio. The message only appears on certain devices (I ran it on a Zenfone 2 with Lineage OS(7.1.1)). My SDK version is 25 and I'm running android studio 2.3.1.
The message says:
Detected problems with app native libraries (please consult log for details):
libavcodec.so: text relocations
libswresample.so: text relocations
Log:
04-08 21:53:06.321 6798-6798/? I/art: Late-enabling -Xcheck:jni
04-08 21:53:06.482 6798-6798/com.platformpetal.platformpetal W/System: ClassLoader referenced unknown path: /data/app/com.platformpetal.platformpetal-1/lib/x86
04-08 21:53:06.494 6798-6798/com.platformpetal.platformpetal I/InstantRun: starting instant run server: is main process
04-08 21:53:06.664 6798-6831/com.platformpetal.platformpetal I/OpenGLRenderer: Initialized EGL, version 1.4
04-08 21:53:06.664 6798-6831/com.platformpetal.platformpetal D/OpenGLRenderer: Swap behavior 1
04-08 21:53:06.665 6798-6831/com.platformpetal.platformpetal W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
04-08 21:53:06.665 6798-6831/com.platformpetal.platformpetal D/OpenGLRenderer: Swap behavior 0
04-08 21:53:08.704 6798-6798/com.platformpetal.platformpetal W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
04-08 21:53:09.158 6798-6798/com.platformpetal.platformpetal W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
04-08 21:53:09.598 6798-6798/com.platformpetal.platformpetal E/WindowManager: android.view.WindowLeaked: Activity com.platformpetal.platformpetal.SplashScreen has leaked window DecorView#aaf4c69[] that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:418)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:331)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94)
at android.app.Dialog.show(Dialog.java:322)
at android.app.AlertDialog$Builder.show(AlertDialog.java:1112)
at android.app.Activity.performStart(Activity.java:6718)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776
)
Here the error message is for the activity being terminated before the message closes. There is nothing I can find which can cause the issue.
P.S. Stack Overflow doesn't allow word problem in question, so I wrote prob_lem
P.P.S. I'm relatively new to android, so don't be harsh :)
This is documented in https://developer.android.com/about/versions/nougat/android-7.0-changes.html#ndk => you need to bundle those .so files with your application, apparently.
Related
I'm developing an Android application that uses a very, very large third-party Java library (netcdf-java). The library makes extensive use of Java 8 features, particularly lambda expressions.
The application works fine on Oreo/API 25+, but crashes and burns on API 21-24 (21 was the oldest I bothered to try testing) with an error that appears to be a NoClassDefFoundError involving lambdas, after a bunch of failed classloads that I've read basically mean, "This version of Android can't do lambdas":
06-14 15:43:05.395 8010-8127/pantherkitty.launchspotter I/art: Rejecting re-init on previously-failed class java.lang.Class<ucar.nc2.-$$Lambda$Group$oysUYWnjlRBOBg2TJn5tet0MooM>
(... snip ...)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ caught exception while parsing GriddedData for /data/user/0/pantherkitty.launchspotter/cache/abi-l2-acmc-57529695.nc : java.io.IOException: java.lang.NoClassDefFoundError: ucar.nc2.-$$Lambda$Group$oysUYWnjlRBOBg2TJn5tet0MooM
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.NetcdfFile.open(NetcdfFile.java:401)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.dataset.NetcdfDataset.openProtocolOrFile(NetcdfDataset.java:831)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:479)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:634)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:86)
06-14 15:43:05.397 8010-8127/pantherkitty.launchspotter E/PRETTY_LOGGER: │ at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:72)
I've read that Google supposedly tweaked Android Studio/Gradle to make Java 8 features backwards-compatible with older devices limited to earlier APIs. Theory aside... I've never seen it actually work, despite using the latest version of Android Studio, upgrading the project to Gradle 3, targeting API=30 (with min API=21), and specifying JavaVersion.VERSION_1_8 for sourceCompatibility and targetCompatibility in build.gradle.
So... is there something else I need to do to enable unfettered Lambda-usage by Android apps running under API 21-24, or is 100% backwards-compatibility with lambdas and older Android devices with only API 21-24 (Lollipop, Marshmallow, and Nougat) something that still doesn't work... and probably won't ever work?
update: I applied Artem Viter's suggestions.
I'm no longer getting the "rejecting re-init on previously failed class" or the "NoClassDefFound" errors for classes that appeared to be lambda-related earlier, but now I'm getting some new errors that are even more mystifying.
I'm not sure whether this is just a new manifestation of my original problem (say, if I'm just seeing an error message arising from desugared code that ultimately boils down to the same thing), or whether this is something completely new and different that ought to have a different question here.
(note: I'm testing it on a Chuwi Hi12 tablet with Intel Cherry Trail SoC and Android 5.1, which might explain the Intel-related errors)
06-14 18:56:35.783 17016-17677/pantherkitty.launchspotter W/art: Failed to open zip archive '/system/framework/com.intel.config.jar': I/O Error
06-14 18:56:35.783 17016-17677/pantherkitty.launchspotter W/art: Failed to open zip archive '/system/framework/com.intel.aware.awareservice.jar': I/O Error
06-14 18:56:35.900 17016-17677/pantherkitty.launchspotter W/art: Failed to open zip archive '/system/framework/com.intel.config.jar': I/O Error
06-14 18:56:35.900 17016-17677/pantherkitty.launchspotter W/art: Failed to open zip archive '/system/framework/com.intel.aware.awareservice.jar': I/O Error
06-14 18:56:35.970 17016-17677/pantherkitty.launchspotter E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: pantherkitty.launchspotter, PID: 17016
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/invoke/MethodHandles;
at ucar.nc2.dataset.EnhanceScaleMissingUnsignedImpl.<clinit>(EnhanceScaleMissingUnsignedImpl.java:30)
at ucar.nc2.dataset.VariableDS.<init>(VariableDS.java:761)
at ucar.nc2.dataset.NetcdfDataset.convertVariable(NetcdfDataset.java:1172)
at ucar.nc2.dataset.NetcdfDataset.convertGroup(NetcdfDataset.java:1156)
at ucar.nc2.dataset.NetcdfDataset.<init>(NetcdfDataset.java:1139)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:485)
at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:634)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:86)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:72)
at pantherkitty.launchspotter.GriddedData.update(GriddedData.java:45)
at pantherkitty.launchspotter.MapsActivity$GriddedDataParserTask.doInBackground(MapsActivity.java:242)
at pantherkitty.launchspotter.MapsActivity$GriddedDataParserTask.doInBackground(MapsActivity.java:221)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.invoke.MethodHandles" on path: DexPathList[[zip file "/data/app/pantherkitty.launchspotter-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at ucar.nc2.dataset.EnhanceScaleMissingUnsignedImpl.<clinit>(EnhanceScaleMissingUnsignedImpl.java:30)
at ucar.nc2.dataset.VariableDS.<init>(VariableDS.java:761)
at ucar.nc2.dataset.NetcdfDataset.convertVariable(NetcdfDataset.java:1172)
at ucar.nc2.dataset.NetcdfDataset.convertGroup(NetcdfDataset.java:1156)
at ucar.nc2.dataset.NetcdfDataset.<init>(NetcdfDataset.java:1139)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:485)
at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:634)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:86)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:72)
at pantherkitty.launchspotter.GriddedData.update(GriddedData.java:45)
at pantherkitty.launchspotter.MapsActivity$GriddedDataParserTask.doInBackground(MapsActivity.java:242)
at pantherkitty.launchspotter.MapsActivity$GriddedDataParserTask.doInBackground(MapsActivity.java:221)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Suppressed: java.lang.ClassNotFoundException: java.lang.invoke.MethodHandles
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 19 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
update 2:
I got the same crash on my Galaxy S3 (running AOSP Marshmallow), but without the four W/art errors related to Intel jarfiles I got on the tablet. The details of the crash itself were substantially identical after that.
I tried to run my login page and suddenly it displays 'Unfortunately app has stop'. Here is my entire logcat stack trace. Any help would be much appreciated.
10-16 11:10:08.946 7285-7285/? I/art: Late-enabling -Xcheck:jni
10-16 11:10:09.022 7285-7285/? W/ResourceType: Found multiple library tables, ignoring...
10-16 11:10:09.028 7285-7285/? W/ResourceType: Found multiple library tables, ignoring...
10-16 11:10:09.036 7285-7285/? W/ResourceType: Found multiple library tables, ignoring...
10-16 11:10:09.762 7285-7358/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
10-16 11:10:09.822 7285-7285/? I/FirebaseInitProvider: FirebaseApp initialization successful
10-16 11:10:09.835 7285-7285/? I/InstantRun: starting instant run server: is main process
10-16 11:10:09.912 7285-7376/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
10-16 11:10:09.940 7285-7376/? I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
10-16 11:10:10.086 7285-7285/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
10-16 11:10:10.104 7285-7285/? W/ResourceType: Found multiple library tables, ignoring...
10-16 11:10:10.420 7285-7285/? I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
10-16 11:10:10.421 7285-7285/? I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
10-16 11:10:10.804 7285-7426/? D/OpenGLRenderer: Render dirty regions requested: true
10-16 11:10:10.818 7285-7285/? D/Atlas: Validating map...
10-16 11:10:11.005 7285-7426/? I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013_msm8226_LA.BF.1.1.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.25.03.00
Build Date: 01/21/15 Wed
Local Branch:
Remote Branch: quic/LA.BF.1.1.1_rb1.7
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013 + NOTHING
10-16 11:10:11.023 7285-7426/? I/OpenGLRenderer: Initialized EGL, version 1.4
10-16 11:10:11.120 7285-7426/? D/OpenGLRenderer: Enabling debug mode 0
10-16 11:10:11.262 7285-7285/? W/art: Before Android 4.1, method int androidx.appcompat.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
10-16 11:10:11.311 7285-7285/? I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#1008e773 time:150860796
10-16 11:10:24.417 7285-7285/? I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#1008e773 time:150873902
10-16 11:10:44.937 7285-7285/? I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzao#19f2a066
10-16 11:10:46.382 7285-7307/? D/FirebaseAuth: Notifying id token listeners about user ( rX50zjEENoQeeUirMV8kn2ARtEk2 ).
10-16 11:10:46.435 7285-7285/? I/Timeline: Timeline: Activity_launch_request id:net.ji.hicadmin time:150895920
10-16 11:10:46.976 7285-7285/? I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.firebase.database.android.AndroidAuthTokenProvider$3>
10-16 11:10:46.977 7285-7285/? I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.firebase.database.android.AndroidAuthTokenProvider$3>
10-16 11:10:47.045 7285-8791/? I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.firebase.database.android.AndroidAuthTokenProvider$3>
10-16 11:10:47.049 7285-8791/? E/RunLoop: Uncaught exception in Firebase Database runloop (3.0.0). Please report to firebase-database-client#google.com
java.lang.NoClassDefFoundError: com.google.firebase.database.android.AndroidAuthTokenProvider$3
at com.google.firebase.database.android.AndroidAuthTokenProvider.produceIdTokenListener(com.google.firebase:firebase-database##16.0.4:85)
at com.google.firebase.database.android.AndroidAuthTokenProvider.addTokenChangeListener(com.google.firebase:firebase-database##16.0.4:80)
at com.google.firebase.database.core.Repo.deferredInitialization(com.google.firebase:firebase-database##16.0.4:109)
at com.google.firebase.database.core.Repo.access$000(com.google.firebase:firebase-database##16.0.4:55)
at com.google.firebase.database.core.Repo$1.run(com.google.firebase:firebase-database##16.0.4:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
10-16 11:10:47.090 7285-7285/? D/AndroidRuntime: Shutting down VM
10-16 11:10:47.096 7285-7285/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: net.ji.hicadmin, PID: 7285
java.lang.RuntimeException: Unable to start activity ComponentInfo{net.ji.hicadmin/net.ji.hicadmin.ListActivity}: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask#17d1d313 rejected from com.google.firebase.database.core.utilities.DefaultRunLoop$1#2658d950[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.access$800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5315)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:736)
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask#17d1d313 rejected from com.google.firebase.database.core.utilities.DefaultRunLoop$1#2658d950[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:592)
at com.google.firebase.database.core.utilities.DefaultRunLoop.scheduleNow(com.google.firebase:firebase-database##16.0.4:105)
at com.google.firebase.database.core.Repo.scheduleNow(com.google.firebase:firebase-database##16.0.4:276)
at com.google.firebase.database.Query.addEventRegistration(com.google.firebase:firebase-database##16.0.4:233)
at com.google.firebase.database.Query.addValueEventListener(com.google.firebase:firebase-database##16.0.4:149)
at net.ji.hicadmin.ListActivity.onCreate(ListActivity.java:45)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.access$800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5315)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:736)
10-16 11:10:52.551 7285-7299/? I/art: Debugger is no longer active
From the log you got java.lang.NoClassDefFoundError: com.google.firebase.database.android.AndroidAuthTokenProvider it seems like you miss something in adding Firebase into your project. First please follow the exact steps in this link.
Make sure to add apply plugin: 'com.google.gms.google-services' at the very bottom of your app module level file
Add app module level dependencies (change versions
according to Firebase versions you're using)
// Firebase Realtime database
implementation 'com.google.firebase:firebase-database:18.0.1'
// Firebase storage
implementation 'com.google.firebase:firebase-storage:18.1.1'
// Firebase authentication
implementation 'com.google.firebase:firebase-auth:18.1.0'
// FirebaseUI authentication
implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
Add Google Services plugin in project level dependency
buildscript {
repositories {
google()
jcenter()
}
dependencies {
// For Firebase -- Google Services plugin
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
}
}
I'm still having this weird problem. ConstraintLayout only works when it's on 'alpha-7', when I change it to '1.0.2' the latest version it shows nothing
Desired layout should look like this:
However, I'm getting this: "on a real HTC one M9 - CM 12.1.1"
** 'Show layout bounds' is On just so you can see that there are nothing on drawn on the device.
** I also tried with 'Show layout update' and it shows nothing as well
In the Layout Inspector the Username field, Password field and Login Button and showing:
XML layout:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/fragment_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/login_background"
android:clickable="true"
tools:context=".ui.login_sing_up.LoginFragment">
<android.support.design.widget.TextInputLayout
android:id="#+id/login_username_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="250dp"
android:textColorHint="#color/Azure"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.design.widget.TextInputEditText
android:id="#+id/login_username"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="#string/Username_or_Email"
android:inputType="textNoSuggestions|textEmailAddress"
android:lines="1"
android:linksClickable="false"
android:textColor="#color/Azure"
android:textColorHighlight="#color/black"
android:textColorHint="#color/Azure"
android:visibility="visible" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/login_password_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColorHint="#color/Azure"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/login_username_container"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="#+id/login_password"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="#string/password"
android:inputType="textPassword"
android:lines="1"
android:linksClickable="false"
android:textColor="#color/Azure"
android:textColorHighlight="#color/black"
android:textColorHint="#color/Azure" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/login_login"
style="#style/Base.Widget.AppCompat.Button.Colored.login"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:text="#string/login"
app:layout_constraintLeft_toLeftOf="#+id/login_password_container"
app:layout_constraintRight_toRightOf="#+id/login_password_container"
app:layout_constraintTop_toBottomOf="#+id/login_password_container" />
</android.support.constraint.ConstraintLayout>
LogCat shows nothing
07-20 20:00:01.028 7144-7144/? I/art: Late-enabling -Xcheck:jni
07-20 20:00:01.083 7144-7158/? E/art: Failed sending reply to debugger: Broken pipe
07-20 20:00:01.084 7144-7158/? I/art: Debugger is no longer active
07-20 20:00:03.344 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx I/LoadedApk: No resource references to update in package common
07-20 20:00:03.344 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx I/LoadedApk: No resource references to update in package com.brit.swiftdark
07-20 20:00:03.346 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx I/InstantRun: starting instant run server: is main process
07-20 20:00:03.473 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx W/ResourceType: For resource 0x01030224, entry index(548) is beyond type entryCount(29)
07-20 20:00:03.473 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx W/ResourceType: For resource 0x01030224, entry index(548) is beyond type entryCount(29)
07-20 20:00:03.511 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-20 20:00:03.614 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: there is no user
07-20 20:00:03.621 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/UserCoordinator: making new Instance
07-20 20:00:03.652 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: checking if there is user in Pref
07-20 20:00:03.653 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: there is no user in Pref
07-20 20:00:03.653 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: there is no user
07-20 20:00:03.658 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: createFragment-LoginFragment
07-20 20:00:03.856 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/LoginFragment: creating ver
07-20 20:00:03.856 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/LoginFragment: done creating ver
07-20 20:00:03.861 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: onResume
07-20 20:00:03.861 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/DispatcherActivity: onResume - null == mUC
07-20 20:00:03.861 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/UserCoordinator: got Instance from preferences
07-20 20:00:03.862 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/UserCoordinator: get userCoordinator
07-20 20:00:03.873 7144-7249/xxxxxxxxxxx.xxxxxxxxxxxxx D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
07-20 20:00:03.877 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx D/Atlas: Validating map...
07-20 20:00:03.878 7144-7169/xxxxxxxxxxx.xxxxxxxxxxxxx W/Binder: Caught a RuntimeException from the binder stub implementation.
java.lang.NullPointerException: Attempt to read from field 'android.view.HardwareRenderer android.view.View$AttachInfo.mHardwareRenderer' on a null object reference
at android.view.WindowManagerGlobal.dumpGfxInfo(WindowManagerGlobal.java:476)
at android.app.ActivityThread$ApplicationThread.dumpGfxInfo(ActivityThread.java:1089)
at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:546)
at android.os.Binder.execTransact(Binder.java:446)
07-20 20:00:03.944 7144-7249/xxxxxxxxxxx.xxxxxxxxxxxxx I/Adreno: QUALCOMM build : 065751b,
Build Date : 04/15/15
OpenGL ES Shader Compiler Version: E031.25.03.07
Local Branch :
Remote Branch : quic/LA.BF64.1.2.1_rb2.9
Remote Branch : NONE
Reconstruct Branch : AU_LINUX_ANDROID_LA.BF64.1.2.1_RB2.05.01.00.081.016 + 065751b + NOTHING
07-20 20:00:03.967 7144-7249/xxxxxxxxxxx.xxxxxxxxxxxxx I/OpenGLRenderer: Initialized EGL, version 1.4
07-20 20:00:03.989 7144-7249/xxxxxxxxxxx.xxxxxxxxxxxxx D/OpenGLRenderer: Enabling debug mode 0
07-20 20:00:04.121 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#3781b87d time:768477070
07-20 20:00:04.130 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
07-20 20:00:04.130 7144-7144/xxxxxxxxxxx.xxxxxxxxxxxxx E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
build.gradle
repositories {
jcenter();
}
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
Things I tried:
Invalidating and restarting Android studio.
Tried on an emulator.
Tried on a Huawei Device.
Tried on an HTC one M9 Device.
Rolling back to 'Alpha-7' works fine.
Please if you need any more details let me know in the comment
After a year of waiting for a real explanation of what is going on and what happened after 'Alpha-7', I "Kindaaa~"figured it out.
The Short Answer
Activities with ConstraintLayout will do fine. however if you are adding a fragment on top, then make sure to make the activity background transparent.
For some reason my app won't call custom application classes onCreate() anymore. Yesterday everything was fine but today my app crashes when it tries to open a connection to Realm.
java.lang.IllegalStateException: Call 'Realm.init(Context)' before calling this method.
Since I do initialize Realm in my custom application classes onCreate() I tried inserting a breakpoint and logging out of the method. Nothing.
This question had a similiar problem
Custom Application class onCreate() never called
I have disabled instant run, cleaned, rebuilt and even restarted android studio but the problem persists. I even tried checking out a commit from three days ago, which was most certainly working, but the result is the same.
Custom application class
public class MyApplication extends Application
{
#Override
public void onCreate()
{
super.onCreate();
JodaTimeAndroid.init(this);
Realm.init(this);
//more Realm initialization code
}
}
Manifest's application section
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:supportsRtl="true"
android:theme="#style/MyTheme">
Any ideas what might cause this and how to get it fixed?
EDIT
Everything logcat puts out before crash
03-19 21:06:10.687 21869-21869/? E/Zygote: v2
03-19 21:06:10.687 21869-21869/? I/libpersona: KNOX_SDCARD checking this for 10323
03-19 21:06:10.687 21869-21869/? I/libpersona: KNOX_SDCARD not a persona
03-19 21:06:10.688 21869-21869/? E/Zygote: accessInfo : 0
03-19 21:06:10.688 21869-21869/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0004, [-1 -1 -1 -1 0 1]
03-19 21:06:10.689 21869-21869/? I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=hailer.com.hailer
03-19 21:06:10.692 21869-21869/? I/art: Late-enabling -Xcheck:jni
03-19 21:06:10.709 21869-21869/? D/TimaKeyStoreProvider: TimaSignature is unavailable
03-19 21:06:10.709 21869-21869/? D/ActivityThread: Added TimaKeyStore provider
03-19 21:06:10.790 21869-21869/hailer.com.hailer D/ContextRelationMgrBrdg: loadKlass() : caller=com.samsung.android.bridge.multiscreen.common.ContextRelationManagerBridge.<clinit>:28 android.app.LoadedApk.makeApplication:833
03-19 21:06:10.814 21869-21869/hailer.com.hailer W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-19 21:06:10.872 21869-21869/hailer.com.hailer D/AndroidRuntime: Shutting down VM
03-19 21:06:10.873 21869-21869/hailer.com.hailer E/AndroidRuntime: FATAL EXCEPTION: main
Process: hailer.com.hailer, PID: 21869
java.lang.RuntimeException: Unable to start activity ComponentInfo{hailer.com.hailer/hailer.com.hailer.activities.MainActivity}: java.lang.IllegalStateException: Call `Realm.init(Context)` before calling this method.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2947)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.IllegalStateException: Call `Realm.init(Context)` before calling this method.
at io.realm.Realm.getDefaultInstance(Realm.java:208)
at hailer.com.hailer.adapters.DiscussionAdapter.<init>(DiscussionAdapter.java:57)
at hailer.com.hailer.fragments.ChatListFragment.onCreateView(ChatListFragment.java:60)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2189)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:757)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2355)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2008)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:607)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at hailer.com.hailer.activities.MainActivity.onStart(MainActivity.java:320)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
at android.app.Activity.performStart(Activity.java:6929)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3008)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
UPDATE
I trimmed down the libraries and disabled multidexing. Didn't help. I also went trough the DiscussionAdapter and ChatListFragment and both are fine. Realm is used in a correct manner and has worked for over a year without issues. I also have log.d("CUSTOMAPPCLS","onCreate called") in my custom application class which does not show in the log. Nor does a breakpoint stop in any part of the onCreate() call.
Now I got a new error. This time it's from PrefsAccessor - a wrapper for SharedPreferences which is also intialised in the custom applications onCreate call. PrefAccessor.init(this); I ran the build again but got the Realm error... The one considering PrefAccessor threw a nullpointer execption when trying to access the SharedPreferences. This further points to the fact that the application onCreate isn't called.
public static string isUseEnterToSendEnabled()
{
SharedPreferences prefs = applicationContext.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);// <-- nullpointer exception: Trying to call .getSharedPreferences on a null object
return prefs.getBoolean(ENTER_TO_SEND, false);
}
I found similar scenario to yours here:
https://github.com/realm/realm-java/issues/1800
The issue seems to be about having lots of libraries included to your project (such as Google Play Services) which might led to your app hitting the 65K methods limit.
Did you include any new dependencies to your project?
UPDATE:
after checking your log, I believe the problem can be here:
hailer.com.hailer.adapters.DiscussionAdapter.(DiscussionAdapter.java:57)
at
hailer.com.hailer.fragments.ChatListFragment.onCreateView(ChatListFragment.java:60)
Maybe in your ChatListFragment, you have an instance of DiscussionAdapter which in turn has some static initializer that invokes something related to Realm.
UPDATE 04/2017
The Samsung S7 started working couple of days after I posted this answer... Black magics all the way I say.
It seems that the Samsung S7 that I usually use for testing is somehow busted. I got some other phones from the office and all of them work just fine. I really have no idea what caused the phone to start crashing the app... None of the other apps are crashing and I didn't download any updates or other apps before this started. I'll post a comment to this answer if I figure this one out and accept this as the solution since I found a "solution"....
I've been storing my project in DropBox to share across computers so I can work from my laptop upstairs. Everything worked fine on my PC, then I went and loaded the project on my laptop and it just crashed when I tried to run it so I gave up and came back to my PC, but now it isn't working there either. It was working fine, I didn't change anything about the code at all. but now I get the error below.
No matter how many gradle syncs and updates and everything that I try I can't figure out how to fix. In addition to fixing this, how am I supposed to work on the same project on multiple PC's without breaking everything?
I ran a Gradle Clean and Sync but it didn't seem to work that time either. Also I didn't even realize I was using AsyncTask, so I'll look at that.
Since I'm not sure exactly what the stack trace is, here's my whole LogCat :)
03-10 14:25:41.849 4830-4830/com.mydomain.myapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-10 14:25:41.960 4830-4830/com.mydomain.myapp I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
03-10 14:25:41.961 4830-4830/com.mydomain.myapp I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
03-10 14:25:41.966 4830-4870/com.mydomain.myapp V/FA: Using measurement service
03-10 14:25:41.966 4830-4870/com.mydomain.myapp V/FA: Connecting to remote service
03-10 14:25:41.967 4830-4870/com.mydomain.myapp V/FA: Activity resumed, time: 4313744
03-10 14:25:41.977 4830-5248/com.mydomain.myapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.mydomain.myapp, PID: 4830
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{36fd80a 4830:com.mydomain.myapp/u0a17} (pid=4830, uid=10017) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
at android.content.ContentResolver.query(ContentResolver.java:475)
at android.content.CursorLoader.loadInBackground(CursorLoader.java:64)
at android.content.CursorLoader.loadInBackground(CursorLoader.java:56)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
03-10 14:25:41.980 4830-5250/com.mydomain.myapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 03-10 14:25:41.982 4830: 4830 D/ ]
HostConnection::get() New Host Connection established 0x7effab5dc260, tid 4830
03-10 14:25:42.283 4830-4830/com.mydomain.myapp D/MainActivity: onAuthStateChanged:signed_out
03-10 14:25:42.314 4830-5250/com.mydomain.myapp I/OpenGLRenderer: Initialized EGL, version 1.4
03-10 14:25:42.314 4830-5250/com.mydomain.myapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
03-10 14:25:42.434 4830-4870/com.mydomain.myapp V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 469
03-10 14:25:42.435 4830-4870/com.mydomain.myapp V/FA: Using measurement service
03-10 14:25:42.435 4830-4870/com.mydomain.myapp V/FA: Connection attempt already in progress
03-10 14:25:42.436 4830-4870/com.mydomain.myapp V/FA: Activity paused, time: 4314214
03-10 14:25:42.457 4830-4870/com.mydomain.myapp D/FA: Connected to remote service
03-10 14:25:42.457 4830-4870/com.mydomain.myapp V/FA: Processing queued up service tasks: 2
03-10 14:25:42.526 4830-4830/com.mydomain.myapp W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
03-10 14:25:42.640 4830-5250/com.mydomain.myapp E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7effa40972a0
First thing, on the original computer on which this project last worked, try a gradle 'clean' and then a build. If that doesn't work, it probably means that you changed the code since it last worked. Try to figure out what you changed, and undo that.
Second, AsyncTask is the source of a lot of headaches (and crashes), because it holds a reference to the Activity from which it was started, but is not part of the Activity's lifecycle, so can operate on the Activity after the Activity has been destroyed. My suggestion - don't use AsyncTask - regardless of what you are using it for, there is almost always a better way. Post your stacktrace here, and we might be able to help you figure out what the problem is.
As far as sharing code, use a version control system. GitHub is good, and it's free. Proper use of it would also let you easily roll your code back to the point where it last worked.
=====
Ok, so looking at the stacktrace that you posted from your logcat, we see:
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{36fd80a 4830:com.mydomain.myapp/u0a17} (pid=4830, uid=10017) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
So, it looks like you are attempting to access the ContactsProvider, but haven't put the READ_CONTACTS permission in your manifest.