Android integration FAQ

This article introduces possible problems and solutions during the Android SDK integration process.

Call the real-person authentication SDK, and the authentication page keeps showing loading

Check the logcat log.

  • If it appears ErrorCode=202, it means there is a problem with the signature picture file (yw_1222_0670.jpg). Generally, the signature of the apk when obtaining the signed image file is inconsistent with the signature of the currently running apk. For details, please refer to the Android integration check signature and use the correctly signed apk to obtain the signed image file. If you confirm that you really need multiple signatures, please upload different signed apk packages to obtain different signature image files, and use the correct signature image file when running.
  • If it appears ErrorCode=203, please confirm whether the following three conditions exist:
    • The signature picture file (yw_1222_0670.jpg) does not exist, please make sure that the signature picture file is in the res/drawable directory.
    • In the Android environment, the signature image file (yw_1222_0670.jpg) may be optimized to 0 KB due to resource optimization. Please check the signature image file (res/drawable/yw_1222_0670.jpg) in the APK. Please refer to the shrinkResources solution. If you are not using the official resource optimization solution, use AndResGuard and other unofficial third-party compression and obfuscation plugins. It is recommended that you refer to the official documentation of the corresponding plug-in to check whether the picture name is confused, or the path is confused, and whether the picture file is compressed.
    • If you find that you can't find the picture after debugging under Android Studio, but confirm that the picture is normal, please turn off the Instant Run function of Android Studio. The apk under Instant Run is not a complete bundle, and its resource files will be split into specific bundles. If the image path changes, the signature image file cannot be found.
  • If it appears ErrorCode=20, please check whether the image file has been updated. Note that the image files of rpsdk 3.1.xx (inclusive) and above and 3.0.xx (inclusive) cannot be shared.

Call the real person authentication SDK and enter the authentication page to display UNKNOWN_ERROR or network abnormality

Check the logcat log.

  • If it appears ErrorCode=1208、1215、1411, it means that the current development package is inconsistent with the package name or signature (keystore) of the package uploaded when downloading the SDK in the management console. Please re-upload the current development package in the management console, and replace the original files in the development package with the yw_1222_*.jpg signature image file in the newly downloaded SDK.

    In engineering, different signatures (keystore) are usually configured for direct running (debug) and official packaging (release) in the IDE. The debug package is compiled and run directly in the IDE, and the signature image file and the release package are different.

  • If it appears ErrorCode=1412、1225, please confirm whether the following three conditions exist:

    • The signature picture file (yw_1222_0670.jpg) does not exist, please make sure that the signature picture file is in the res/drawable directory.
    • In the Android environment, the signature image file (yw_1222_0670.jpg) may be optimized to 0 KB due to resource optimization. Please check the signature image file (res/drawable/yw_1222_0670.jpg) in the APK. Please refer to the shrinkResources solution. If you are not using the official resource optimization solution, use AndResGuard and other unofficial third-party compression and obfuscation plugins. It is recommended that you refer to the official documentation of the corresponding plug-in to check whether the picture name is confused, or the path is confused, and whether the picture file is compressed.
    • If you find that you can't find the picture after debugging under Android Studio, but you have confirmed that the picture is normal, please turn off the Instant Run function of Android Studio. The apk under Instant Run is not a complete bundle, and its resource files will be split into specific bundles. If the image path changes, the signature image file cannot be found.

The components previously introduced in the project overlap with those in the real person authentication SDK, such as SecurityGuardSDK, oss-android-sdk

If SecurityGuardSDK components are duplicated, delete the lower version, but you need to keep the yw_1222_*.jpg signature image file in the version; if other components such as oss-android-sdk are duplicated, delete the lower version.

Merge Manifest error when accessing the real person authentication SDK

Added to the application node in AndroidManifest.xml tools:replace="android:allowBackup".

Compile error when the integrated real person authentication SDK is enabled for obfuscation

Add the corresponding configuration in the ProGuard configuration file, for example:

dontwarn com.taobao.securityjni.**
keep class com.taobao.securityjni.*{;}
dontwarn com.taobao.wireless.security.**
keep class com.taobao.wireless.security.*{;}
dontwarn com.ut.secbody.**
keep class com.ut.secbody.*{;}
dontwarn com.taobao.dp.**
keep class com.taobao.dp.*{;}
dontwarn com.alibaba.wireless.security.**
keep class com.alibaba.wireless.security.*{;}
dontwarn com.alibaba.security.rp.**
keep class com.alibaba.security.rp.*{;}
dontwarn com.alibaba.sdk.android.**
keep class com.alibaba.sdk.android.*{;}
dontwarn com.alibaba.security.biometrics.**
keep class com.alibaba.security.biometrics.*{;}
dontwarn android.taobao.windvane.**
keep class android.taobao.windvane.**{*;}

It crashes when you enter the authentication page, and the log reports an error: Error inflating class com.alibaba.security.rp.view.TopBar

Check whether there is a top_bar.xml layout file with the same name in the res/layout directory of the application. If it exists, please modify the file with the same name.

When performing live body recognition, it prompts that the face verification failed or the photo is stuck at 0% when uploading photos

  • Please confirm whether there is a problem with your network (such as whether the network is connected, whether the URL proxy is turned on, etc.).
  • Please check whether the current mobile phone system version is Android 9 and above. If the OSS SDK version is below 2.9.0, please upgrade to 2.9.0 and above.
  • If the connected rpsdk is version 3.0.0.3 and below, please check whether the application has not applied for read and write permissions for external storage. If you don't have read and write permissions, you need to enable storage permissions in the application permission management area, or directly upgrade rpsdk to the latest version.
  • If the above problem does not exist, please provide logcat logs. If you cannot provide the runtime system log, please provide verifyToken, ticketId and other information during authentication.

App uses a plug-in mechanism. What should I pay attention to when integrating the Android SDK for real person authentication?

It is recommended that you put the real person authentication Android SDK under the main Bundle.

This article  has been included in the open source project: https://github.com/Android-Alvin/Android-LearningNotes , which contains self-learning programming routes in different directions, interview questions/faces, and a series of technical articles. The resources are continuously updated …

Guess you like

Origin blog.csdn.net/weixin_43901866/article/details/110143827
Recommended