Failure to import contacts, "Cannot cast value for is_primary to a Integer"
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The stack trace ends in Android's ContactsProvider, so the cast error comes from a ContentValues insert, and the app's VCF import code is the likely source of the boolean is_primary value. Search the Kotlin import code for is_primary and check how it is written into ContentValues. Reproduce by importing a VCF with several phone numbers and watching the logcat. Done when the import completes without the ClassCastException and the dialog closes after OK.
索引モデルが issue の本文から書いたものです。
説明
Checklist
- I can reproduce the bug with the latest version given here.
- I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- This issue contains only one bug.
- I have read and understood the contribution guidelines.
Affected app version
1.6.0
Affected Android/Custom ROM version
/e/OS 3.7.3 based on Android 15
Affected device model
Fairphone 6
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
adb push contacts_20260527_224723.vcf /storage/self/primary/- Go to 'Settings'
- Select 'Import contacts from a .vcf file'
- Select the vcf
- keep "target contacts source" as "DEVICE"
- press OK
Expected behavior
The dialog should not remain after we select "OK", and the cast exception should not be there.
Actual behavior
After a few seconds of "Importing..." toast displayed on top of the dialog just validated, the toast goes away while the dialog remains, then if people just wait (which is not what most people do in front of a long wait, see below) the dialog disappears, we're back to the UI, and at some point we get a notification that contacts were imported.
During this import time we can see loads of errors like the one below logged, I assume their large number causes the slowdown, apparent lack of responsiveness, and lets the dialog possible to interact with during import:
05-27 23:39:21.765 2299 5017 W AppSearchIcing: icing-search-engine.cc:364: Error: 5, Message: Document (android$contacts/, 3992) not found.
05-27 23:39:21.788 5496 11967 E ContentValues: Cannot cast value for is_primary to a Integer: false
05-27 23:39:21.788 5496 11967 E ContentValues: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Number
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentValues.getAsInteger(ContentValues.java:350)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.DataRowHandler.insert(DataRowHandler.java:122)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.DataRowHandlerForCommonDataKind.insert(DataRowHandlerForCommonDataKind.java:47)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.DataRowHandlerForPhoneNumber.insert(DataRowHandlerForPhoneNumber.java:53)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.ContactsProvider2.insertData(ContactsProvider2.java:3435)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.ContactsProvider2.insertInTransaction(ContactsProvider2.java:3220)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.AbstractContactsProvider.insert(AbstractContactsProvider.java:161)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.ContactsProvider2.insert(ContactsProvider2.java:2404)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProvider.insert(ContentProvider.java:1961)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProviderOperation.applyInternal(ContentProviderOperation.java:375)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProviderOperation.apply(ContentProviderOperation.java:352)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.AbstractContactsProvider.applyBatch(AbstractContactsProvider.java:286)
05-27 23:39:21.788 5496 11967 E ContentValues: at com.android.providers.contacts.ContactsProvider2.applyBatch(ContactsProvider2.java:2921)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProvider.applyBatch(ContentProvider.java:2695)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:524)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:212)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.os.Binder.execTransactInternal(Binder.java:1406)
05-27 23:39:21.788 5496 11967 E ContentValues: at android.os.Binder.execTransact(Binder.java:1350)
(I'm pretty sorry the following description highlights quite a few bugs showing as a side effect of the above large delay, it would seem awkward to log them separately, I guess they all appear because that dialog was never intended to be interacted with more than once, and disabling its controls would be enough to avoid all of them)
During this long time, trying to understand what was going on, I successively did:
- press "OK" again, which triggers a new import (which is not necessarily understood as such initially, only while browsing, when seeing the multiple "DEVICE" lines denoting dups)
- press outside the dialog, after which we see a partial import (visible with only a few letters on the alphabet index on the right). But then after selecting all and deleting to prepare a new import attempt, I notice that more contacts arrived in the meantime
- press "cancel", which actually seems to stop the importing, but after deleting all the selectable records, I still see more of them actually appeared later
Screenshots/Screen recordings
No response
Additional information
This is an import of a 536-records VCF file generated by Fossify Contacts 1.6.0 on a OnePlus 6 running OxygenOS 11.1.2.2 based on Android 11.
- 主要言語
- Kotlin
- スター
- 917
- フォーク
- 73
- 平均マージ
- 5日 8時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FossifyOrg/Contacts のほかの issue
-
feature request needs triage
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
FossifyOrg/Contacts#176 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
bug needs triage
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
FossifyOrg/Contacts#618 ·
メンテナーはふだん 4 日以内に返信
-
feature request needs triage
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
FossifyOrg/Contacts#614 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
New field: IBANオープンfeature request needs triage
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
FossifyOrg/Contacts#613 ·
メンテナーはふだん 4 日以内に返信
-
bug needs triage
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
FossifyOrg/Contacts#612 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 4 日以内に返信
FossifyOrg/Contacts の issue をすべて見る
似ている issue
-
[BUG] Navigation drawer drops library-name suffixes without ellipsis (1.0.8, NVIDIA Shield)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
damontecres/Wholphin#2069 ·
メンテナーはふだん 1 日以内に返信
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
margelo/react-native-vision-camera#4217 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
saisaharsh3/Leftovers#13 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
navikt/esyfo-narmesteleder#700 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nightscout/AndroidAPS#5280 ·
メンテナーはふだん 1 日以内に返信