HMS-Core / hms-ml-demo

HMS ML Demo provides an example of integrating Huawei ML Kit service into applications. This example demonstrates how to integrate services provided by ML Kit, such as face detection, text recognition, image segmentation, asr, and tts.
https://developer.huawei.com/consumer/en/hms/huawei-mlkit?ha_source=hms1
Apache License 2.0
356 stars 120 forks source link

App crash when updating to 3.0.0.301 #80

Closed Mouadabdelghafouraitali closed 3 years ago

Mouadabdelghafouraitali commented 3 years ago
    implementation 'com.huawei.hms:ml-computer-vision-segmentation:3.0.0.301'
    implementation 'com.huawei.hms:ml-computer-vision-image-segmentation-multiclass-model:3.0.0.301'
    implementation 'com.huawei.hms:ml-computer-vision-image-segmentation-body-model:3.0.0.301'
public class ImageSegmentation {

    private MLImageSegmentationAnalyzer analyzer;

    public void analyzer(Bitmap src, MLCallBack mlCallBack) {
        MLImageSegmentationSetting setting = new MLImageSegmentationSetting.Factory()
                .setExact(true)
                .setAnalyzerType(MLImageSegmentationSetting.BODY_SEG)
                .setScene(MLImageSegmentationScene.FOREGROUND_ONLY)
                .create();
        this.analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer(setting);
        MLFrame mlFrame = new MLFrame.Creator().setBitmap(src).create();
        Task<MLImageSegmentation> task = this.analyzer.asyncAnalyseFrame(mlFrame);
        task.addOnSuccessListener(imageSegmentationResult -> {
            if (imageSegmentationResult != null) mlCallBack.onMLCompleted(imageSegmentationResult);
            else mlCallBack.onMLFailed();
        }).addOnFailureListener(e -> mlCallBack.onMLFailed());
    }

}
2021-08-04 00:35:50.103 32383-32383/maa.abc.background_changer E/ActivityThread: Failed to find provider info for com.huawei.hms
2021-08-04 00:35:50.109 32383-32383/maa.abc.background_changer E/AbstractInitializer: huawei_module_mlkit_imgseg -> No need to switch because the context of the dynamic module is null or the context of full sdk
2021-08-04 00:35:50.109 32383-32383/maa.abc.background_changer E/AbstractInitializer: huawei_module_mlkit_imgseg -> The context of the dynamic module belongs to LOCAL
2021-08-04 00:35:50.156 32383-32383/maa.abc.background_changer E/HIAI_DDK_MSG: /AiDllParser.cpp Load(45)::"dlopen load lib failed,lib[/system/lib64/libhiai_foundation.huawei.so],errmsg [dlopen failed: can't read file "/data/app/~~tmU2wHTAY38LvsdjeofDpA==/maa.abc.background_changer-QDVrIWUG8BkHCusrq3t_HQ==/lib/arm64": Is a directory]"
Mouadabdelghafouraitali commented 3 years ago

https://stackoverflow.com/a/68665689/7954210