nextcloud / nextcloud/talk-android

use libphonenumber for phone number validation

Open
#1,051 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

approved bug feature: settings ⚙️
Dominant language
Kotlin
Stars
739
Forks
321
Avg merge
14h 59m
Merged PRs (30d)
151

Description

to improve #1050 the phone number validation should be done locally with https://github.com/google/libphonenumber

Validate phone number

  • when enabling phone book integration and asking for number
  • while setting phone number in profile settings

Problem (and it's the same problem for https://github.com/nextcloud/talk-android/issues/1035):
when including this lib, the app won't build and following errors occur:

I/org.webrtc.Logging: NativeLibrary: Loading native library: jingle_peerconnection_so
I/org.webrtc.Logging: NativeLibrary: Loading library: jingle_peerconnection_so
E/org.webrtc.Logging: NativeLibrary: Failed to load native library: jingle_peerconnection_so
E/org.webrtc.Logging: NativeLibrary: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/lib/arm, /data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libjingle_peerconnection_so.so"
E/org.webrtc.Logging: NativeLibrary: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/lib/arm, /data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libjingle_peerconnection_so.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
        at java.lang.System.loadLibrary(System.java:1669)
        at org.webrtc.NativeLibrary$DefaultLoader.load(NativeLibrary.java:21)
        at org.webrtc.NativeLibrary.initialize(NativeLibrary.java:44)
        at org.webrtc.PeerConnectionFactory.initialize(PeerConnectionFactory.java:294)
        at com.nextcloud.talk.application.NextcloudTalkApplication.initializeWebRtc(NextcloudTalkApplication.kt:108)
        at com.nextcloud.talk.application.NextcloudTalkApplication.onCreate(NextcloudTalkApplication.kt:128)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5949)
        at android.app.ActivityThread.access$1200(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
E/oud.talk2.debu: No implementation found for void org.webrtc.PeerConnectionFactory.nativeInitializeAndroidGlobals() (tried Java_org_webrtc_PeerConnectionFactory_nativeInitializeAndroidGlobals and Java_org_webrtc_PeerConnectionFactory_nativeInitializeAndroidGlobals__)
W/NextcloudTalkApplication: java.lang.UnsatisfiedLinkError: No implementation found for void org.webrtc.PeerConnectionFactory.nativeInitializeAndroidGlobals() (tried Java_org_webrtc_PeerConnectionFactory_nativeInitializeAndroidGlobals and Java_org_webrtc_PeerConnectionFactory_nativeInitializeAndroidGlobals__)
        at org.webrtc.PeerConnectionFactory.nativeInitializeAndroidGlobals(Native Method)
        at org.webrtc.PeerConnectionFactory.initialize(PeerConnectionFactory.java:295)
        at com.nextcloud.talk.application.NextcloudTalkApplication.initializeWebRtc(NextcloudTalkApplication.kt:108)
        at com.nextcloud.talk.application.NextcloudTalkApplication.onCreate(NextcloudTalkApplication.kt:128)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5949)
        at android.app.ActivityThread.access$1200(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
W/oud.talk2.debu: Verification of com.nextcloud.talk.jobs.ContactAddressBookWorker com.nextcloud.talk.application.DaggerNextcloudTalkApplicationComponent.injectContactAddressBookWorker(com.nextcloud.talk.jobs.ContactAddressBookWorker) took 178.721ms
I/dav4android: Registering DAV property factories
D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.nextcloud.talk2.debug, PID: 31443
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/lib/arm, /data/app/com.nextcloud.talk2.debug-poiq7nZOX42eiZPSoQmy9A==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libsqlcipher.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
        at java.lang.System.loadLibrary(System.java:1669)
        at net.sqlcipher.database.SQLiteDatabase$1.loadLibraries(SQLiteDatabase.java:213)
        at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:230)
        at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:209)
        at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:202)
        at io.requery.android.sqlcipher.SqlCipherDatabaseSource.<init>(SqlCipherDatabaseSource.kt:56)
        at com.nextcloud.talk.dagger.modules.DatabaseModule.provideSqlCipherDatabaseSource(DatabaseModule.java:49)
        at com.nextcloud.talk.dagger.modules.DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.provideSqlCipherDatabaseSource(DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.java:41)
        at com.nextcloud.talk.dagger.modules.DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.get(DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.java:31)
        at com.nextcloud.talk.dagger.modules.DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.get(DatabaseModule_ProvideSqlCipherDatabaseSourceFactory.java:10)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.nextcloud.talk.dagger.modules.DatabaseModule_ProvideDataStoreFactory.get(DatabaseModule_ProvideDataStoreFactory.java:32)
        at com.nextcloud.talk.dagger.modules.DatabaseModule_ProvideDataStoreFactory.get(DatabaseModule_ProvideDataStoreFactory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.nextcloud.talk.utils.database.user.UserModule_ProvideUserUtilsFactory.get(UserModule_ProvideUserUtilsFactory.java:31)
        at com.nextcloud.talk.utils.database.user.UserModule_ProvideUserUtilsFactory.get(UserModule_ProvideUserUtilsFactory.java:10)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideKeyManagerFactory.get(RestModule_ProvideKeyManagerFactory.java:35)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideKeyManagerFactory.get(RestModule_ProvideKeyManagerFactory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideSslSocketFactoryCompatFactory.get(RestModule_ProvideSslSocketFactoryCompatFactory.java:36)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideSslSocketFactoryCompatFactory.get(RestModule_ProvideSslSocketFactoryCompatFactory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideHttpClientFactory.get(RestModule_ProvideHttpClientFactory.java:59)
        at com.nextcloud.talk.dagger.modules.RestModule_ProvideHttpClientFactory.get(RestModule_ProvideHttpClientFactory.java:16)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.nextcloud.talk.application.DaggerNextcloudTalkApplicationComponent.injectNextcloudTalkApplication(DaggerNextcloudTalkApplicationComponent.java:660)
        at com.nextcloud.talk.application.DaggerNextcloudTalkApplicationComponent.inject(DaggerNextcloudTalkApplicationComponent.java:341)
        at com.nextcloud.talk.application.NextcloudTalkApplication.onCreate(NextcloudTalkApplication.kt:133)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5949)
        at android.app.ActivityThread.access$1200(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
I/Process: Sending signal. PID: 31443 SIG: 9
Disconnected from the target VM, address: 'localhost:38637', transport: 'socket'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported build and startup failures after adding libphonenumber, focusing on NextcloudTalkApplication.kt at the cited initialization points. Trace the phone-number flows for phone book integration and profile settings, then verify that both validate locally and that the app still builds and starts without the reported native-library failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.