我在Android智能手机One plus One上遇到了我的Cordova应用程序故障(设备产品:培根型号:A0001设备:A0001)。
我在存储库中找不到任何问题:https://github.com/alsorokin/cordova-plugin-contacts
我的代码有错误吗?你能告诉我我能做什么吗? 谢谢。
这是AngularJS函数:
getAllContacts : function(){
var deferred = $q.defer();
var onSuccess = function(contacts) {
deferred.resolve(contacts);
};
var onError = function(contactError) {
deferred.reject(contactError);
};
var options = new ContactFindOptions();
options.filter = "";
options.multiple = true;
var fields = ["*"];
navigator.contacts.find(fields, onSuccess, onError, options);
return deferred.promise;
},
以下是我从ADB LOGCAT获得的崩溃日志:
I/chromium(10453): [INFO:CONSOLE(95)] "getContacts", source: file:///android_asset/www/app/components/contacts/ContactsService.js (95)
D/LBSSystemMonitorService( 758): handleMessage what - 4
D/Wiper_jni( 758): Send Network Location.
I/chromium(10453): [INFO:CONSOLE(22)] "$ionicView.enter ListContactsCtrl", source: file:///android_asset/www/app/components/contacts/importContactsController.js (22)
I/chromium(10453): [INFO:CONSOLE(5)] "homeCtrl", source: file:///android_asset/www/app/components/home/homeController.js (5)
W/CursorWindow(17276): Window is full: requested allocation 168 bytes, free space 75 bytes, window size 2097152 bytes
I/art ( 758): Explicit concurrent mark sweep GC freed 186688(8MB) AllocSpace objects, 9(144KB) LOS objects, 28% free, 40MB/56MB, paused
4.019ms total 193.548ms
D/HeadsetStateMachine( 3762): Disconnected process message: 10, size: 0
W/ActivityManager( 758): getRunningAppProcesses: caller 10086 does not hold REAL_GET_TASKS; limiting output
I/art (17276): Explicit concurrent mark sweep GC freed 36472(2MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 19MB/33MB, paused
2.271ms total 58.172ms
W/ActivityManager( 758): getRunningAppProcesses: caller 10103 does not hold REAL_GET_TASKS; limiting output
D/HeadsetStateMachine( 3762): Disconnected process message: 10, size: 0
E/CursorWindow(10453): Could not create CursorWindow from Parcel due to error -12.
--------- beginning of crash
E/AndroidRuntime(10453): FATAL EXCEPTION: pool-3-thread-3
E/AndroidRuntime(10453): Process: net.myapp.app, PID: 10453
E/AndroidRuntime(10453): android.database.CursorWindowAllocationException: Cursor window could not be created from binder.
E/AndroidRuntime(10453): at android.database.CursorWindow.<init>(CursorWindow.java:137)
E/AndroidRuntime(10453): at android.database.CursorWindow.<init>(CursorWindow.java:42)
E/AndroidRuntime(10453): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:685)
E/AndroidRuntime(10453): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:683)
E/AndroidRuntime(10453): at android.database.BulkCursorDescriptor.readFromParcel(BulkCursorDescriptor.java:75)
E/AndroidRuntime(10453): at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:34)
E/AndroidRuntime(10453): at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:30)
E/AndroidRuntime(10453): at android.content.ContentProviderProxy.query(ContentProviderNative.java:424)
E/AndroidRuntime(10453): at android.content.ContentResolver.query(ContentResolver.java:478)
E/AndroidRuntime(10453): at android.content.ContentResolver.query(ContentResolver.java:422)
E/AndroidRuntime(10453): at org.apache.cordova.contacts.ContactAccessorSdk5.photoQuery(ContactAccessorSdk5.java:910)
E/AndroidRuntime(10453): at org.apache.cordova.contacts.ContactAccessorSdk5.populateContactArray(ContactAccessorSdk5.java:439)
E/AndroidRuntime(10453): at org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:271)
E/AndroidRuntime(10453): at org.apache.cordova.contacts.ContactManager$1.run(ContactManager.java:93)
E/AndroidRuntime(10453): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(10453): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(10453): at java.lang.Thread.run(Thread.java:818)
W/DropBoxManagerService( 758): Dropping: data_app_crash (1587 > 0 bytes)
D/LogFetchServiceManager( 4073): Received entry added
W/ActivityManager( 758): Force finishing activity 1 net.myapp.app/.MainActivity
D/OpenGLRenderer( 758): Use EGL_SWAP_BEHAVIOR_PRESERVED: true