DJI-Mobile-SDK-Tutorials / Android-VideoStreamDecodingSample

This sample project demonstrates how to use FFmpeg for video frame parsing and to use MediaCodec for hardware decoding on DJI Products.
MIT License
169 stars 80 forks source link

with msdk-v4.10 runtime error #54

Open hexray-newbee opened 5 years ago

hexray-newbee commented 5 years ago
samoilovich commented 5 years ago

I have the same issue when just ask dji sdk about something. As an example DJISDKManager.getInstance().product If you need more details, please let me know I will create demo app with this crash.

And this crash is not related for video stream decoding. It happens from the start of app.

sdk version: 4.10 mobile: Sumsung S7 edge android studio: 3.4

Ray-DJI commented 5 years ago

Hi, @hxl-dy @samoilovich . DJI SDK with 4.10 have updated the secure strategies. Please add following lines in your project build.gradle packagingOptions {

doNotStrip "*/*/libdjivideo.so"
doNotStrip "*/*/libSDKRelativeJNI.so"
doNotStrip "*/*/libFlyForbid.so"
doNotStrip "*/*/libduml_vision_bokeh.so"
doNotStrip "*/*/libyuv2.so"
doNotStrip "*/*/libGroudStation.so"
doNotStrip "*/*/libFRCorkscrew.so"
doNotStrip "*/*/libUpgradeVerify.so"
doNotStrip "*/*/libFR.so"

// Add the new so
doNotStrip "*/*/libDJIFlySafeCore.so"
doNotStrip "*/*/libdjifs_jni.so"
doNotStrip "*/*/libsfjni.so"
exclude 'META-INF/rxjava.properties'

}

Thanks for the feedback, we will update the tutorial with the SDK 4.10 as soon as possible.

Padreco-lbr commented 5 years ago

Same problem with me, adding these lines does not solve it. Looks like it happens on call to DJISDKManager.getInstance().getSDKVersion()...

StackTrace:

> 2019-06-01 20:38:44.748 E/sfjni: Couldn't load lib
> 2019-06-01 20:38:44.748 E/zygote: No implementation found for void com.dji.megatronking.stringfog.StringUtilsJNI.test() (tried Java_com_dji_megatronking_stringfog_StringUtilsJNI_test and Java_com_dji_megatronking_stringfog_StringUtilsJNI_test__)
> 2019-06-01 20:38:44.748 D/AndroidRuntime: Shutting down VM
> 2019-06-01 20:38:44.753 E/AndroidRuntime: FATAL EXCEPTION: main
>     Process: com.panorama_id.codecapture, PID: 20026
>     java.lang.UnsatisfiedLinkError: No implementation found for void com.dji.megatronking.stringfog.StringUtilsJNI.test() (tried Java_com_dji_megatronking_stringfog_StringUtilsJNI_test and Java_com_dji_megatronking_stringfog_StringUtilsJNI_test__)
>         at com.dji.megatronking.stringfog.StringUtilsJNI.test(Native Method)
>         at com.dji.megatronking.stringfog.a.c.b(Unknown Source:3)
>         at dji.midware.e.b(Unknown Source:2)
>         at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
>         at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
Michael-DJI commented 5 years ago

@PadreCocoRocha thanks for the feedback, could you please provide a public github repo? with that our developer could clone it and reproduce your issue.

chano1025 commented 5 years ago

clean project -> rebuild project

Padreco-lbr commented 5 years ago

clean project -> rebuild project

That solved for me, thank you

ghost commented 5 years ago

Out of curiosity: Where is that 4.10 SDK available? All the sample apps are still using 4.9.

Ray-DJI commented 5 years ago

@accuware Our 4.10 SDK already have published for almost one month, and the VideoStreamDecodingSample have updated with the latest 4.10 SDK.

ghost commented 5 years ago

@Ray-DJI I see. This is surprising, since I cloned the sample a week ago. I see you have updated 5 days ago...Since you also have updated the YUV part I will check it out. Thanks

samoilovich commented 5 years ago

@Ray-DJI I faced one more issue. Your previous solution works! But when I tried to test release version with turned on proguard I get the crash: Process: com.measure.groundcontrol, PID: 22027 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/arch/lifecycle/LifecycleObserver; at dji.sdk.sdkmanager.DJISDKManager.getInstance

Could you help with that?

samoilovich commented 5 years ago

@Ray-DJI I have added keep annotation to proguard file for android architecture component from this link https://gist.github.com/brownsoo/9b11a823360c9cf184263df3e669375c And it helped but I think that this moment should be fixed. Please let me know if you need any info.

Ray-DJI commented 5 years ago

Hi, @samoilovich You are right, the architecture component should keep from obfuscating, because our SDK AAR Package depends on the architecture component aar. Each time when we release a new version, we will give the proguard file to tell the developer which class or method should be kept. You can refer to the DJI sample APP for more information about proguard file.

samoilovich commented 5 years ago

Any dji sample app? hmmm. https://docker.pkg.github.com/DJI-Mobile-SDK-Tutorials/Android-VideoStreamDecodingSample I tried to find here the proguard file. But could :( Could you send a link?

Ray-DJI commented 5 years ago

@samoilovich The link is below https://github.com/dji-sdk/Mobile-SDK-Android/blob/master/Sample%20Code/app/proguard-rules.pro