
build.gradle, and add the dependency reference:dependencies {...implementation fileTree(dir: 'libs', include: ['*.jar','*.aar']) // Add .jar and .aar dependency libraries to the project// Add the libpag dependencyimplementation "com.tencent.tav:libpag:4.4.35-harfbuzz"}
// Set the License during Application initializationTELicenseCheck.getInstance().setTELicense(context, TAV_MAGIC_LICENSE, TAV_MAGIC_KEY, (errorCode, msg) ->Log.v(TAG, String.format("auth check result, errorCode: %d, msg: %s", errorCode, msg));
Error Code | Description |
0 | Success. |
-1 | Invalid input parameters, for example, an empty URL or KEY. |
-3 | The download step failed. Please check your network settings. |
-4 | The TE authorization information read from local storage is empty, possibly due to an IO failure. |
-5 | The content of the VCUBE TEMP License file is empty, possibly due to an IO failure. |
-6 | The JSON fields in the v_cube.license file are incorrect. Please contact the Tencent Cloud team for assistance. |
-7 | Signature verification failed. Please contact the Tencent Cloud team for assistance. |
-8 | Decryption failed. Please contact the Tencent Cloud team for assistance. |
-9 | The JSON fields in TELicense are incorrect. Please contact the Tencent Cloud team for assistance. |
-10 | The TE authorization information parsed from the network is empty. Please contact the Tencent Cloud team for assistance. |
-11 | Failed to write the TE authorization information to a local file, possibly due to an IO failure. |
-12 | Download failed, and parsing the local asset also failed. |
-13 | Authentication failed. Please check whether the .so file is included in the package or whether the .so path has been set correctly. |
3004/3005 | Invalid authorization. Please contact the Tencent Cloud team for assistance. |
3015 | Bundle ID / Package Name does not match. Check whether the Bundle ID / Package Name used by your app is consistent with the one used in the application, and whether you are using the correct authorization file. |
3018 | The authorization file has expired. You need to contact Tencent Cloud to renew it. |
Others | Please contact the Tencent Cloud team for assistance. |
// Copy logic implemented in InitUtilprivate static void copyAssets() {String currentVersion = getAppVersion();if (!TextUtils.equals(getSavedVersionCode(), currentVersion)) {new File(mSdkAssetPath).mkdirs();FileUtil.copyAssets(mAppContext, "resource", mResourcePath);TAVMagicBase.installAIModelFilesFromAssets(mAppContext, mSdkAssetPath);saveVersionCode(currentVersion);}}
// Initialize the SDK and configure parameters (using static libraries)boolean loadRet = TAVMagicBase.initSDK(mAppContext, mSdkAssetPath);// Or initialize with dynamic libraries (optional)boolean loadRet = TAVMagicBase.initSDK(mAppContext, mSdkAssetPath, "/path/to/dynamic/libs");// Set the log level (optional)TAVMagicBase.setLogLevel(Log.VERBOSE);// Configure thumbnail cache (optional)int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);int cacheSize = maxMemory / 4;TAVMagicBase.setThumbnailMemoryCacheSize(cacheSize);
피드백