tencent cloud

Feedback

Technical

Last updated: 2024-02-19 17:15:02

    When I built my Android application for release, an error occurred saying that some methods were not found. What should I do?

    If you enable optimization (by setting minifyEnabled to true) when building your application, some code that is not called at the Java layer will be removed. However, such code may be called at the native layer, causing a no xxx method error.
    To fix the issue, add the following keep rules to prevent the code from being removed:
    -keep class com.tencent.xmagic.** { *;}
    -keep class org.light.** { *;}
    -keep class org.libpag.** { *;}
    -keep class org.extra.** { *;}
    -keep class com.gyailib.**{ *;}
    -keep class com.tencent.cloud.iai.lib.** { *;}
    -keep class com.tencent.beacon.** { *;}
    -keep class com.tencent.qimei.** { *;}
    -keep class androidx.exifinterface.** { *;}

    What should I do if a GSON library conflict error occurs when I integrate the SDK into my host Android project?

    Add the following code to the build.gradle file of the host project:
    Android{
    configurations {
    all*.exclude group: 'com.google.code.gson'
    }
    }

    What should I do if the SO libraries fail to be loaded when Android targetSdkVersion is 31 or larger?

    When Android targetSdkVersion is 31 or larger, you need to open the AndroidManifest.xml file in app and add the following tag to application:
    <uses-native-library
    android:name="libOpenCL.so"
    android:required="true" />
    //`true` indicates that the library is a must for the application to run. The application cannot be installed on a system without the library.
    //`false` indicates that the application can use the library if it is available, but can also run without it. It can be installed on a system without the library. If you set the parameter to `false`, you need to deal with the issues that may arise due to the absence of the library.
    //Android website introduction: %!s(<nil>)
    For more information, see <uses-native-library>.

    If the texture passed when using beauty filters is a horizontal texture, how to solve it?

    You can use the 'convert' method in the TextureConverter.java utility class in the demo to rotate the texture and convert it to portrait mode, and then pass it to the beauty SDK.
    /**
    * This method is used to rotate and mirror the RGBA texture. The process is to first rotate the texture Proceed in a clockwise direction. by 'rotation' degrees (which can take values of 0, 90, 180, 270), and then perform a horizontal flip (flipHorizontal) and a vertical flip (flipVertical)
    * Use case: Some streaming SDKs return horizontal textures or the characters in the image are facing the wrong direction, while the Tencent effect SDK requires that the characters in the texture are facing forward. Therefore, this method can be used to convert the texture.
    *
    * @param srcID: The RGBA texture.
    * @param width: The width of the texture.
    * @param height: The height of the texture.
    * @param rotation: The angle of rotation.
    * @Returns: The rotated texture. Note: If rotated 90 or 270 degrees, the width needs to be swapped.
    */
    public int convert(int srcID, int width, int height, @RotationDegreesValue int rotation, boolean flipVertical, boolean flipHorizontal)

    If the texture passed when using beauty filters is an OES texture, how to solve it?

    You can use the 'oes2Rgba' method in the TextureConverter.java utility class in the demo to convert the texture to an RGBA texture, and then pass it to the beauty SDK.
    /**
    * This method is used to convert an OES texture to an RGBA texture
    *
    * @param srcID: The OES texture.
    * @param width: The width of the texture.
    * @param height: The height of the texture.
    * @Returns: The ID of the RGBA texture.
    */
    public int oes2Rgba(int srcID, int width, int height)

    What if I want to use another version of PAG? Supported by V3.5.0

    When the client integrates the beauty filter SDK:
    If integrated through Maven, TencentEffect can be introduced via implement. If you does not wish to use this version of pag, it can be excluded through:
    implementation ('com.tencent.mediacloud:TencentEffect_S1-04:version'){ exclude group: "com.tencent.tav", module: "libpag"
    }
    If manually integrated with the beautification SDK through download, the dependency on TencentEffect.aar is without pag. you would still need to add a line in their app's build.gradle to implement pag for usage.
    implementation 'com.tencent.tav:libpag:4.3.33-noffavc'
    To dynamically download the .so libraries, you need to obtain them from the official download page and only integrate the .aar.

    When I tried to run my iOS project in Xcode 12.x after importing the resources, the error “Building for iOS Simulator, but the linked and embedded framework '.framework'...” occurred. What should I do?

    Go to Build Settings > Build Options, change Validate Workspace to Yes, and click Run.
    Note:
    If you change Validate Workspace back to No after compilation, you can still run your project successfully.

    What should I do if the filter settings don't take effect?

    Check the value you set (value range: 0-100). The effect may not be obvious if the value is too small.

    What should I do if a dSYM generation error occurs when I compile the iOS demo project?

    Error message:
    PhaseScriptExecution CMake\\ PostBuild\\ Rules build/XMagicDemo.build/Debug-iphoneos/XMagicDemo.build/Script-81731F743E244CF2B089C1BF.sh
    cd /Users/zhenli/Downloads/xmagic_s106
    /bin/sh -c /Users/zhenli/Downloads/xmagic_s106/build/XMagicDemo.build/Debug-iphoneos/XMagicDemo.build/Script-81731F743E244CF2B089C1BF.sh
    
    Command /bin/sh failed with exit code 1
    Cause: Failed to sign libpag.framework and Masonary.framework again.
    Solution:
    1.1 Open demo/copy_framework.sh.
    1.2 Change $(which cmake) to the absolute path of the local CMake.
    1.3 Change Apple Development: ...... to your own account signature.

    What should I do if an authorization error occurs when I enter the homepage of the iOS demo?

    Check the error code in the log. If a local license file is used, check whether the file has been added to the project.

    What should I do if an error occurs when I build the iOS demo project?

    Error message:
    unexpected service error: build aborted due to an internal error: unable to write manifest to-xxxx-manifest.xcbuild': mkdir(/data, S_IRWXU | S_IRWXG | S_IRWXO): Read-only file system (30):
    Solution:
    1.1 Go to File > Project settings > Build System and select Legacy Build System.
    1.2 For Xcode 13.0++, you need to select File > Workspace Settings > Do not show a diagnostic issue about build system deprecation.

    What are the relationships between different effect properties?

    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support