Problem starting DJI simulation [dji-sdk] - android

I'm trying to implement the sample code of dji developer for android but i can't start the app, i add my com.dji.sdk.API_KEY and when i launch the app i get this errors:
2020-04-03 19:44:10.734 5567-5607/com.dji.sdk.sample E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.dji.sdk.sample, PID: 5567
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString() (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString and Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)
at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native Method)
at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:32)
at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
at com.dji.sdk.sample.internal.controller.MainActivity$5.run(:241)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
If you need code of any thing i can post it too. Thanks.
EDIT:
I can do it with an hardware Samsung, not in virtual device.

I'm using an emulator, but the MSDK doesn't support it.
It only works with a real device.

Related

Crashes happend in camera plugin used in flutter modules,

firebase crash logs one.
Fatal Exception: java.lang.IllegalStateException: CameraDevice was already closed
at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2236)
at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSessionInternal(CameraDeviceImpl.java:658)
at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSession(CameraDeviceImpl.java:644)
at io.flutter.plugins.camera.Camera$DefaultCameraDeviceWrapper.createCaptureSession(Camera.java:175)
at io.flutter.plugins.camera.Camera.createCaptureSessionWithSessionConfig(Camera.java:479)
at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:465)
at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:387)
at io.flutter.plugins.camera.Camera.startPreview(Camera.java:1074)
at io.flutter.plugins.camera.Camera$1.onOpened(Camera.java:322)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
firebase crash logs two.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.camera2.CameraCaptureSession.close()' on a null object reference
at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1192)
at io.flutter.plugins.camera.Camera.access$500(Camera.java:100)
at io.flutter.plugins.camera.Camera$1.onClosed(Camera.java:342)
at android.hardware.camera2.impl.CameraDeviceImpl$5.run(CameraDeviceImpl.java:255)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.os.HandlerThread.run(HandlerThread.java:67)
two crashes caught in my firebase account.
by investigations, It happened at the camera plugin used in flutter modules,
It's happening on android devices only, versions are 9 to 12 versions.
Used plugin details:
camera: ^0.10.0
https://pub.dev/packages/camera
any one can help with this, ?

Android ION post request failing

I've tried to make a POST request using ION as showcased here but I'm getting the following errors.
2020-11-30 14:08:37.353 8610-8651/com.example.test_app E/AndroidRuntime: FATAL EXCEPTION: ion-ion
Process: com.example.test_app, PID: 8610
java.lang.AssertionError
at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:492)
at com.koushikdutta.async.AsyncSSLSocketWrapper.handleHandshakeStatus(AsyncSSLSocketWrapper.java:378)
at com.koushikdutta.async.AsyncSSLSocketWrapper.handshake(AsyncSSLSocketWrapper.java:182)
at com.koushikdutta.async.http.AsyncSSLSocketMiddleware.tryHandshake(AsyncSSLSocketMiddleware.java:89)
at com.koushikdutta.async.http.AsyncSSLSocketMiddleware$2.onConnectCompleted(AsyncSSLSocketMiddleware.java:106)
at com.koushikdutta.async.http.AsyncSocketMiddleware.lambda$getSocket$3$AsyncSocketMiddleware(AsyncSocketMiddleware.java:217)
at com.koushikdutta.async.http.-$$Lambda$AsyncSocketMiddleware$glazjOxu-iNIRY4N890Wl1ngyGo.onCompleted(Unknown Source:12)
at com.koushikdutta.async.future.SimpleFuture.lambda$setCallback$0(SimpleFuture.java:212)
at com.koushikdutta.async.future.-$$Lambda$SimpleFuture$h_gK5Y1XHZI1H8JTE2xOg4dXbp8.onCompleted(Unknown Source:2)
at com.koushikdutta.async.future.SimpleFuture$FutureCallsite.loop(SimpleFuture.java:130)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java:153)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:191)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:174)
at com.koushikdutta.async.future.-$$Lambda$VNAuWcttAhMr3VsWCERbmWE6yR0.success(Unknown Source:2)
at com.koushikdutta.async.future.SimpleFuture.lambda$success$4(SimpleFuture.java:279)
at com.koushikdutta.async.future.-$$Lambda$SimpleFuture$DxIsaj7NQi76eWgOKS4iviWPLV0.onCompleted(Unknown Source:4)
at com.koushikdutta.async.future.SimpleFuture$FutureCallsite.loop(SimpleFuture.java:130)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java:153)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:191)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:178)
at com.koushikdutta.async.http.-$$Lambda$cBC5du-82c5EcL72rP5wNK7Y2Y4.onConnectCompleted(Unknown Source:2)
at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:896)
at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:717)
at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46)
at com.koushikdutta.async.AsyncServer$11.run(AsyncServer.java:671)
Any idea? Thanks.
I found the solution, the problem was that this library doesn't seem to work with Gradle versions newer than 4.0.1.

No tests were found on Android Virtual Device Emulator API 30 (UI tests)

I updated Android Studio till 4.1.1, i updated everything for launching emulator AVD on API 30,
but i get "No tests were found" when i'm trying to launch my UI-tests (Espresso framework) on that emulator.
In the same time i have no any problems with emulator 29 or below.
--------- beginning of crash
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: FATAL EXCEPTION: main
PID: 24852
java.lang.IllegalArgumentException: Wrong number of arguments; expected 6, got 3
at java.lang.reflect.Method.invoke(Native Method)
at androidx.test.services.speakeasy.client.ToolConnection$ToolConnectionPostIcs.doCall(ToolConnection.java:197)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:79)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:69)
at androidx.test.services.shellexecutor.BlockingPublish.getResult(BlockingPublish.java:74)
at androidx.test.services.shellexecutor.ShellCommandExecutorServer.start(ShellCommandExecutorServer.java:80)
at androidx.test.services.shellexecutor.ShellMain.main(ShellMain.java:45)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Bad file descriptor
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at android.app.IActivityManager$Stub$Proxy.handleApplicationCrash(IActivityManager.java:5182)
at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:158)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
2020-11-24 18:04:31.036 24852-24852 I/Process: Sending signal. PID: 24852 SIG: 9
Does anybody know what's the problem?
Thank a lot!
You should add permission WAKE_LOCK and increase androidx test orchestrator version. Also you should check actual versions for espresso core, rules and test runner.

How to work with Splunk Mint and Facebook ads in same project

I've been trying to integrate Facebook ads in my app for Android with the audience-network-sdk:5.0.0 and Facebook sdk crashed with this error:
10-16 13:12:07.128 25301-25725/? D/ProxyCache: Open connection to http://127.0.0.1:43557/ping
10-16 13:12:08.318 25301-25586/? E/ProxyCache: Error pinging server [attempt: 2, timeout: 1200].
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:176)
at com.facebook.ads.internal.r.b.f.b(Unknown Source)
at com.facebook.ads.internal.r.b.f.<init>(Unknown Source)
at com.facebook.ads.internal.r.b.f.<init>(Unknown Source)
at com.facebook.ads.internal.f.d$1.a(Unknown Source)
at com.facebook.ads.internal.f.d$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Shutdown server... Error pinging server [attempts: 3, max timeout: 1200].
10-16 13:12:08.318 25301-25586/? I/ProxyCache: Shutdown proxy server
10-16 13:12:08.328 25301-25602/? W/System.err: java.lang.InterruptedException
10-16 13:12:08.348 25301-25602/? W/System.err: at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:1031)
at java.lang.Thread.sleep(Thread.java:985)
at com.splunk.mint.ExceptionHandler.uncaughtException(ExceptionHandler.java:64)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
10-16 13:12:08.348 25301-25602/? E/AndroidRuntime: FATAL EXCEPTION: Thread-12294
PID: 25301
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.FileDescriptor.setInt$(int)' on a null object reference
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:93)
at java.net.ServerSocket.implAccept(ServerSocket.java:216)
at java.net.ServerSocket.accept(ServerSocket.java:140)
at com.facebook.ads.internal.r.b.f.e(Unknown Source)
at com.facebook.ads.internal.r.b.f.a(Unknown Source)
at com.facebook.ads.internal.r.b.f$e.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
As you can see the trace just tell you that the ping (and the connection to local host) failed but it doesn't tell you more. I am not solving it because it only happens in physical device and only with my app (the example app from Facebook runs great in the same device and same network).
I don't know why is happening and how to fix it.
So I finally found the error and the solution.
Let me explain the error:
Facebook ads SDK uses localhost Proxy cache to download the assets of the ads
I also use Splunk Mint to track errors of my app in production.
Splunk Mint library has issues with the http monitoring:
Disable network monitoring
The solution was to add this line before init Mint SDK:
Mint.disableNetworkMonitoring();

FATAL EXCEPTION: GoogleApiHandler

In my project i'm using the monetization service(Vungle/AppLovin).
When I'm trying to load an ad, i get this exception
E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: kz.ikar, PID: 3673
java.lang.NoSuchMethodError: No virtual method setChannelId(Ljava/lang/String;)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/kz.ikar-2oCl4DY4J8w7wP-jirbYvA==/split_lib_dependencies_apk.apk)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:225)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:15)
at com.google.android.gms.common.api.internal.zzbm.zzc(Unknown Source:4)
at com.google.android.gms.common.api.internal.zzbo.onConnectionFailed(Unknown Source:104)
at com.google.android.gms.common.api.internal.zzbo.connect(Unknown Source:83)
at com.google.android.gms.common.api.internal.zzbo.zza(Unknown Source:47)
at com.google.android.gms.common.api.internal.zzbm.handleMessage(Unknown Source:283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
In my project I have two fragments in one activity. The user gets an ad in the second one. If I load an ad from the activity, it works well. What can be the cause of this issue?
By the way both ad networks(Vungle and AppLovin) return this exception
I had the same problem and I fixed it downgrading to firebase Google Play services 11.6.0
One reason you could be getting this error is if your buildToolsVersion in your app-level Gradle is less than 26. Either that or your v4 support is less than 26.0.0 seeing as NotificationCompat.Builder was added in API 26.

Categories

Resources