Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native executable (not working with AWS CRT) again #598

Open
DevTester888 opened this issue Sep 27, 2024 · 11 comments
Open

Native executable (not working with AWS CRT) again #598

DevTester888 opened this issue Sep 27, 2024 · 11 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@DevTester888
Copy link

DevTester888 commented Sep 27, 2024

Describe the bug

I get an issue which looks like #408.

The version is 1.21.0.
Java Version: 9.0
Could some one help this? Thanks.

09-27 11:04:32.749 27790 27790 D AndroidRuntime: Shutting down VM
09-27 11:04:32.752 27790 27790 E AndroidRuntime: FATAL EXCEPTION: main
09-27 11:04:32.752 27790 27790 E AndroidRuntime: Process: com.xxxxxxxxx.android.aws_iot_device_service, PID: 27790
09-27 11:04:32.752 27790 27790 E AndroidRuntime: java.lang.ExceptionInInitializerError
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at software.amazon.awssdk.crt.CrtResource.(CrtResource.java:104)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at software.amazon.awssdk.iot.AwsIotMqtt5ClientBuilder.newDirectMqttBuilderWithMtlsFromPath(AwsIotMqtt5ClientBuilder.java:74)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at com.xxxxxxxxx.android.aws_iot_device_service.AwsIotDeviceService.setupMqttClientProperty(AwsIotDeviceService.java:211)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at com.xxxxxxxxx.android.aws_iot_device_service.AwsIotDeviceService.onCreate(AwsIotDeviceService.java:43)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:3953)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:219)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.os.Looper.loop(Looper.java:252)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7404)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: Caused by: software.amazon.awssdk.crt.CrtRuntimeException: software.amazon.awssdk.crt.CrtRuntimeException: Unable to unpack AWS CRT library UNKNOWN(-1) UNKNOWN(-1)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at software.amazon.awssdk.crt.CRT.loadLibraryFromJar(CRT.java:381)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: at software.amazon.awssdk.crt.CRT.(CRT.java:45)
09-27 11:04:32.752 27790 27790 E AndroidRuntime: ... 13 more

Expected Behavior

Pass the crt and run continue.

Current Behavior

Pass the crt and run continue.

Reproduction Steps

Run the code. (10/10)

AwsIotMqtt5ClientBuilder builder =
AwsIotMqtt5ClientBuilder.newDirectMqttBuilderWithMtlsFromPath(
clientEndpoint, certificateData, keyData);

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.21.0

Environment details (OS name and version, etc.)

Android 10 (AOSP)

@DevTester888 DevTester888 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2024
@jmklix
Copy link
Member

jmklix commented Sep 27, 2024

Are you using GraalVM?

@jmklix jmklix added p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2024
@DevTester888
Copy link
Author

@jmklix
No, we dont use GraalVM.

private boolean checkGraalVM() {
try {
Class.forName("org.graalvm.home.Version");
return true;
} catch (ClassNotFoundException e) {
return false;
}

final boolean IS_AOT = Boolean.parseBoolean(System.getProperty("com.oracle.graalvm.isaot"));
Log.d(TAG, ">> msg IS_AOT:" + IS_AOT + " checkGraalVM:" + checkGraalVM());
// AwsIotDeviceService: >> msg IS_AOT:false checkGraalVM:false

@DevTester888
Copy link
Author

DevTester888 commented Sep 30, 2024

@jmklix

The OS is Android 10 aarch64 (arm64-v8a) (AOSP) (Android Open Source Project)
https://source.android.com/

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Sep 30, 2024
@DevTester888
Copy link
Author

The example code is

final String clientEndpoint = getClientEndpoint();
Log.d(TAG, ">> msg " + "clientEndpoint:" + clientEndpoint);

final String certificateData = getCertificateData();
Log.d(TAG, ">> msg " + "certificateData:" + certificateData);

final String keyData = getKeyData();
Log.d(TAG, ">> msg " + "keyData:" + keyData);

Long port = 1883L;
Mqtt5ClientOptions.Mqtt5ClientOptionsBuilder optionsBuilder = new Mqtt5ClientOptions.Mqtt5ClientOptionsBuilder(clientEndpoint, port);
Log.d(TAG, ">> msg " + "Mqtt5ClientOptions");

SampleLifecycleEvents sampleLifecycleEvents = new SampleLifecycleEvents();
optionsBuilder.withLifecycleEvents(sampleLifecycleEvents);
Log.d(TAG, ">> msg " + "SampleLifecycleEvents");

SamplePublishEvents samplePublishEvents = new SamplePublishEvents(input_count);
optionsBuilder.withPublishEvents(samplePublishEvents);
Log.d(TAG, ">> msg " + "SamplePublishEvents");

String clientId = getClientId();
ConnectPacketBuilder connectBuilder = new ConnectPacketBuilder();
connectBuilder.withClientId(clientId);
Log.d(TAG, ">> msg " + "ConnectPacketBuilder");

PublishPacketBuilder willBuilder = new PublishPacketBuilder("test/topic/will", QOS.AT_MOST_ONCE, "Goodbye".getBytes());
connectBuilder.withWill(willBuilder.build());
Log.d(TAG, ">> msg " + "PublishPacketBuilder");

optionsBuilder.withConnectOptions(connectBuilder.build());
Log.d(TAG, ">> msg " + "withConnectOptions");

Mqtt5Client tttclient = new Mqtt5Client(optionsBuilder.build());
tttclient.start();
Log.d(TAG, ">> msg " + "Mqtt5Client");

Exception is

09-30 10:27:03.550 24478 24478 D AndroidRuntime: Shutting down VM
09-30 10:27:03.551 24478 24478 E AndroidRuntime: FATAL EXCEPTION: main
09-30 10:27:03.551 24478 24478 E AndroidRuntime: Process: com.xxxxxxxxx.android.aws_iot_device_service, PID: 24478
09-30 10:27:03.551 24478 24478 E AndroidRuntime: java.lang.ExceptionInInitializerError
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at software.amazon.awssdk.crt.CrtResource.<clinit>(CrtResource.java:8)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at com.xxxxxxxxx.android.aws_iot_device_service.AwsIotDeviceService.onCreate(AwsIotDeviceService.java:28)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3953)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.app.ActivityThread.access$1500(ActivityThread.java:219)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:252)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7404)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: Caused by: software.amazon.awssdk.crt.CrtRuntimeException: software.amazon.awssdk.crt.CrtRuntimeException: Unable to unpack AWS CRT library UNKNOWN(-1) UNKNOWN(-1)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	at software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:32)
09-30 10:27:03.551 24478 24478 E AndroidRuntime: 	... 11 more

The log is

09-30 10:27:02.048 24455 24455 D AwsIotDeviceService: >> msg clientEndpoint:OOOOOOOOOOOOOOOOOOOO
09-30 10:27:03.527 24478 24478 D AwsIotDeviceService: >> msg certificateData:-----BEGIN CERTIFICATE-----
09-30 10:27:03.527 24478 24478 D AwsIotDeviceService: >> msg keyData:-----BEGIN RSA PRIVATE KEY-----
09-30 10:27:03.529 24478 24478 D AwsIotDeviceService: >> msg Mqtt5ClientOptions
09-30 10:27:03.530 24478 24478 D AwsIotDeviceService: >> msg SampleLifecycleEvents
09-30 10:27:03.530 24478 24478 D AwsIotDeviceService: >> msg SamplePublishEvents
09-30 10:27:03.530 24478 24478 D AwsIotDeviceService: >> msg ConnectPacketBuilder
09-30 10:27:03.531 24478 24478 D AwsIotDeviceService: >> msg PublishPacketBuilder
09-30 10:27:03.531 24478 24478 D AwsIotDeviceService: >> msg withConnectOptions

@DevTester888
Copy link
Author

DevTester888 commented Sep 30, 2024

Screenshot_2024-09-30_at_1_49_30 PM Screenshot 2024-09-30 at 1 55 45 PM

Dear,
My environment is Android 10 aarch64 (arm64-v8a) .
I try to download the dependence libs and dump.

aws-crt-0.30.0.jar aws-iot-device-sdk-1.21.0.jar gson-2.9.0.jar

// ======= aws-crt-0.30.0.jar ======

META-INF/MANIFEST.MF
META-INF/
linux/
linux/armv6/
linux/armv6/glibc/
linux/armv7/
linux/armv7/glibc/
linux/armv7/musl/
linux/armv8/
linux/armv8/glibc/
linux/armv8/musl/
linux/x86_32/
linux/x86_32/glibc/
linux/x86_64/
linux/x86_64/glibc/
linux/x86_64/musl/
osx/
osx/armv8/
osx/armv8/cruntime/
osx/x86_64/
osx/x86_64/cruntime/
windows/
windows/x86_64/
windows/x86_64/cruntime/
windows/x86_32/
windows/x86_32/cruntime/
META-INF/native-image/
META-INF/native-image/software.amazon.awssdk/
META-INF/native-image/software.amazon.awssdk/crt/
META-INF/native-image/software.amazon.awssdk/crt/aws-crt/
software/
software/amazon/
software/amazon/awssdk/
software/amazon/awssdk/crt/
software/amazon/awssdk/crt/http/
software/amazon/awssdk/crt/mqtt5/
software/amazon/awssdk/crt/mqtt5/packets/
software/amazon/awssdk/crt/io/
software/amazon/awssdk/crt/eventstream/
software/amazon/awssdk/crt/s3/
software/amazon/awssdk/crt/auth/
software/amazon/awssdk/crt/auth/credentials/
software/amazon/awssdk/crt/auth/signing/
software/amazon/awssdk/crt/checksums/
software/amazon/awssdk/crt/utils/
software/amazon/awssdk/crt/mqtt/
software/amazon/awssdk/crt/cal/
META-INF/maven/
META-INF/maven/software.amazon.awssdk.crt/
META-INF/maven/software.amazon.awssdk.crt/aws-crt/
linux/armv6/glibc/libaws-crt-jni.so
linux/armv8/glibc/libaws-crt-jni.so
linux/x86_32/glibc/libaws-crt-jni.so
linux/x86_64/musl/libaws-crt-jni.so
windows/x86_64/cruntime/aws-crt-jni.dll
META-INF/native-image/software.amazon.awssdk/crt/aws-crt/jni-config.json
META-INF/native-image/software.amazon.awssdk/crt/aws-crt/reflect-config.json
META-INF/native-image/software.amazon.awssdk/crt/aws-crt/resource-config.json
software/amazon/awssdk/crt/AsyncCallback$1.class
software/amazon/awssdk/crt/AsyncCallback.class
software/amazon/awssdk/crt/http/HttpRequest.class
software/amazon/awssdk/crt/http/HttpRequestBase.class
software/amazon/awssdk/crt/http/HttpHeader.class
software/amazon/awssdk/crt/http/HttpRequestBodyStream.class
software/amazon/awssdk/crt/http/HttpVersion.class
software/amazon/awssdk/crt/http/HttpProxyOptions$HttpProxyAuthorizationType.class
software/amazon/awssdk/crt/http/HttpProxyOptions$HttpProxyConnectionType.class
software/amazon/awssdk/crt/http/HttpProxyOptions.class
software/amazon/awssdk/crt/http/Http2StreamManager.class
software/amazon/awssdk/crt/http/Http2StreamManagerOptions.class
software/amazon/awssdk/crt/http/Http2Request.class
software/amazon/awssdk/crt/http/HttpStreamBaseResponseHandler.class
software/amazon/awssdk/crt/http/Http2Stream.class
software/amazon/awssdk/crt/http/HttpStreamBase.class
software/amazon/awssdk/crt/http/HttpManagerMetrics.class
software/amazon/awssdk/crt/http/HttpStreamResponseHandlerNativeAdapter.class
software/amazon/awssdk/crt/http/HttpStreamResponseHandler.class
software/amazon/awssdk/crt/http/HttpStreamMetrics.class
software/amazon/awssdk/crt/http/HttpStream$HttpStreamWriteChunkCompletionCallback.class
software/amazon/awssdk/crt/http/HttpStream$1.class
software/amazon/awssdk/crt/http/HttpStream.class
software/amazon/awssdk/crt/http/Http2ClientConnection$Http2ErrorCode.class
software/amazon/awssdk/crt/http/Http2ClientConnection.class
software/amazon/awssdk/crt/http/HttpClientConnection.class
software/amazon/awssdk/crt/http/Http2ConnectionSetting$ID.class
software/amazon/awssdk/crt/http/Http2ConnectionSetting.class
software/amazon/awssdk/crt/http/Http2ConnectionSettingListBuilder.class
software/amazon/awssdk/crt/http/HttpException.class
software/amazon/awssdk/crt/http/HttpClientConnectionManagerOptions.class
software/amazon/awssdk/crt/http/HttpProxyEnvironmentVariableSetting$HttpProxyEnvironmentVariableType.class
software/amazon/awssdk/crt/http/HttpProxyEnvironmentVariableSetting.class
software/amazon/awssdk/crt/http/HttpMonitoringOptions.class
software/amazon/awssdk/crt/http/HttpHeaderBlock.class
software/amazon/awssdk/crt/http/HttpClientConnectionManager.class
software/amazon/awssdk/crt/mqtt5/packets/ConnectPacket$ConnectPacketBuilder.class
software/amazon/awssdk/crt/mqtt5/packets/ConnectPacket$1.class
software/amazon/awssdk/crt/mqtt5/packets/ConnectPacket.class
software/amazon/awssdk/crt/mqtt5/packets/DisconnectPacket$DisconnectReasonCode.class
software/amazon/awssdk/crt/mqtt5/packets/DisconnectPacket$DisconnectPacketBuilder.class
software/amazon/awssdk/crt/mqtt5/packets/DisconnectPacket$1.class
software/amazon/awssdk/crt/mqtt5/packets/DisconnectPacket.class
software/amazon/awssdk/crt/mqtt5/packets/PublishPacket$PayloadFormatIndicator.class
software/amazon/awssdk/crt/mqtt5/packets/PublishPacket$PublishPacketBuilder.class
software/amazon/awssdk/crt/mqtt5/packets/PublishPacket$1.class
software/amazon/awssdk/crt/mqtt5/packets/PublishPacket.class
software/amazon/awssdk/crt/mqtt5/packets/SubscribePacket$RetainHandlingType.class
software/amazon/awssdk/crt/mqtt5/packets/SubscribePacket$Subscription.class
software/amazon/awssdk/crt/mqtt5/packets/SubscribePacket$SubscribePacketBuilder.class
software/amazon/awssdk/crt/mqtt5/packets/SubscribePacket$1.class
software/amazon/awssdk/crt/mqtt5/packets/SubscribePacket.class
software/amazon/awssdk/crt/mqtt5/packets/SubAckPacket$SubAckReasonCode.class
software/amazon/awssdk/crt/mqtt5/packets/SubAckPacket.class
software/amazon/awssdk/crt/mqtt5/packets/UnsubscribePacket$UnsubscribePacketBuilder.class
software/amazon/awssdk/crt/mqtt5/packets/UnsubscribePacket$1.class
software/amazon/awssdk/crt/mqtt5/packets/UnsubscribePacket.class
software/amazon/awssdk/crt/mqtt5/packets/UnsubAckPacket$UnsubAckReasonCode.class
software/amazon/awssdk/crt/mqtt5/packets/UnsubAckPacket.class
software/amazon/awssdk/crt/mqtt5/packets/UserProperty.class
software/amazon/awssdk/crt/mqtt5/packets/PubAckPacket$PubAckReasonCode.class
software/amazon/awssdk/crt/mqtt5/packets/PubAckPacket.class
software/amazon/awssdk/crt/mqtt5/packets/ConnAckPacket$ConnectReasonCode.class
software/amazon/awssdk/crt/mqtt5/packets/ConnAckPacket.class
software/amazon/awssdk/crt/mqtt5/Mqtt5Client.class
software/amazon/awssdk/crt/mqtt5/Mqtt5WebsocketHandshakeTransformArgs.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$LifecycleEvents.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$PublishEvents.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$ClientSessionBehavior.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$ExtendedValidationAndFlowControlOptions.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$ClientOfflineQueueBehavior.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$Mqtt5ClientOptionsBuilder.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions.class
software/amazon/awssdk/crt/mqtt5/PublishResult$PublishResultType.class
software/amazon/awssdk/crt/mqtt5/PublishResult.class
software/amazon/awssdk/crt/mqtt5/Mqtt5ClientOperationStatistics.class
software/amazon/awssdk/crt/mqtt5/QOS.class
software/amazon/awssdk/crt/mqtt5/TopicAliasingOptions$OutboundTopicAliasBehaviorType.class
software/amazon/awssdk/crt/mqtt5/TopicAliasingOptions$InboundTopicAliasBehaviorType.class
software/amazon/awssdk/crt/mqtt5/TopicAliasingOptions.class
software/amazon/awssdk/crt/mqtt5/PublishReturn.class
software/amazon/awssdk/crt/mqtt5/OnAttemptingConnectReturn.class
software/amazon/awssdk/crt/mqtt5/OnConnectionSuccessReturn.class
software/amazon/awssdk/crt/mqtt5/OnConnectionFailureReturn.class
software/amazon/awssdk/crt/mqtt5/OnDisconnectionReturn.class
software/amazon/awssdk/crt/mqtt5/OnStoppedReturn.class
software/amazon/awssdk/crt/mqtt5/NegotiatedSettings.class
software/amazon/awssdk/crt/CrtResource$ResourceInstance.class
software/amazon/awssdk/crt/CrtResource.class
software/amazon/awssdk/crt/io/ExponentialBackoffRetryOptions$JitterMode.class
software/amazon/awssdk/crt/io/ExponentialBackoffRetryOptions.class
software/amazon/awssdk/crt/io/ClientBootstrap.class
software/amazon/awssdk/crt/io/EventLoopGroup.class
software/amazon/awssdk/crt/io/HostResolver.class
software/amazon/awssdk/crt/io/SocketOptions$SocketDomain.class
software/amazon/awssdk/crt/io/SocketOptions$SocketType.class
software/amazon/awssdk/crt/io/SocketOptions.class
software/amazon/awssdk/crt/io/TlsContext.class
software/amazon/awssdk/crt/io/TlsContextOptions$TlsVersions.class
software/amazon/awssdk/crt/io/TlsContextOptions.class
software/amazon/awssdk/crt/io/TlsCipherPreference.class
software/amazon/awssdk/crt/io/TlsContextPkcs11Options.class
software/amazon/awssdk/crt/io/TlsContextCustomKeyOperationOptions.class
software/amazon/awssdk/crt/io/TlsKeyOperationHandler.class
software/amazon/awssdk/crt/io/TlsKeyOperation$Type.class
software/amazon/awssdk/crt/io/TlsKeyOperation$CrtResourceInternal.class
software/amazon/awssdk/crt/io/TlsKeyOperation.class
software/amazon/awssdk/crt/io/TlsSignatureAlgorithm.class
software/amazon/awssdk/crt/io/TlsHashAlgorithm.class
software/amazon/awssdk/crt/io/Pkcs11Lib$InitializeFinalizeBehavior.class
software/amazon/awssdk/crt/io/Pkcs11Lib.class
software/amazon/awssdk/crt/io/TlsConnectionOptions.class
software/amazon/awssdk/crt/io/StandardRetryOptions.class
software/amazon/awssdk/crt/io/ClientTlsContext.class
software/amazon/awssdk/crt/io/DirectoryEntry.class
software/amazon/awssdk/crt/io/ServerTlsContext.class
software/amazon/awssdk/crt/io/DirectoryTraversalHandler.class
software/amazon/awssdk/crt/io/DirectoryTraversal.class
software/amazon/awssdk/crt/io/ServerBootstrap.class
software/amazon/awssdk/crt/io/Uri.class
software/amazon/awssdk/crt/CrtRuntimeException.class
software/amazon/awssdk/crt/Log$LogDestination.class
software/amazon/awssdk/crt/Log$LogLevel.class
software/amazon/awssdk/crt/Log$LogSubject.class
software/amazon/awssdk/crt/Log$1.class
software/amazon/awssdk/crt/Log.class
software/amazon/awssdk/crt/eventstream/Header$1.class
software/amazon/awssdk/crt/eventstream/Header.class
software/amazon/awssdk/crt/eventstream/HeaderType.class
software/amazon/awssdk/crt/eventstream/MessageFlags.class
software/amazon/awssdk/crt/eventstream/Message.class
software/amazon/awssdk/crt/eventstream/ServerListenerHandler.class
software/amazon/awssdk/crt/eventstream/ServerConnection$1.class
software/amazon/awssdk/crt/eventstream/ServerConnection.class
software/amazon/awssdk/crt/eventstream/ServerConnectionHandler.class
software/amazon/awssdk/crt/eventstream/MessageType.class
software/amazon/awssdk/crt/eventstream/ServerConnectionContinuation.class
software/amazon/awssdk/crt/eventstream/ServerConnectionContinuationHandler.class
software/amazon/awssdk/crt/eventstream/MessageFlushCallback.class
software/amazon/awssdk/crt/eventstream/ClientConnectionContinuation$1.class
software/amazon/awssdk/crt/eventstream/ClientConnectionContinuation$2.class
software/amazon/awssdk/crt/eventstream/ClientConnectionContinuation.class
software/amazon/awssdk/crt/eventstream/ClientConnectionHandler.class
software/amazon/awssdk/crt/eventstream/ClientConnection$1.class
software/amazon/awssdk/crt/eventstream/ClientConnection.class
software/amazon/awssdk/crt/eventstream/ClientConnectionContinuationHandler.class
software/amazon/awssdk/crt/eventstream/OperationRoutingServerConnectionHandler$1.class
software/amazon/awssdk/crt/eventstream/OperationRoutingServerConnectionHandler.class
software/amazon/awssdk/crt/eventstream/ServerListener.class
software/amazon/awssdk/crt/s3/ResumeToken$PutResumeTokenBuilder.class
software/amazon/awssdk/crt/s3/ResumeToken.class
software/amazon/awssdk/crt/s3/S3MetaRequestOptions$MetaRequestType.class
software/amazon/awssdk/crt/s3/S3MetaRequestOptions.class
software/amazon/awssdk/crt/s3/ChecksumConfig$ChecksumLocation.class
software/amazon/awssdk/crt/s3/ChecksumConfig.class
software/amazon/awssdk/crt/s3/S3MetaRequestResponseHandler.class
software/amazon/awssdk/crt/s3/ChecksumAlgorithm.class
software/amazon/awssdk/crt/s3/S3FinishedResponseContext.class
software/amazon/awssdk/crt/s3/S3MetaRequestProgress.class
software/amazon/awssdk/crt/s3/S3ExpressCredentialsProvider.class
software/amazon/awssdk/crt/s3/S3ExpressCredentialsProviderHandler.class
software/amazon/awssdk/crt/s3/S3ExpressCredentialsProperties.class
software/amazon/awssdk/crt/s3/S3ExpressCredentialsProviderFactory.class
software/amazon/awssdk/crt/s3/S3Client.class
software/amazon/awssdk/crt/s3/S3ClientOptions.class
software/amazon/awssdk/crt/s3/S3MetaRequest.class
software/amazon/awssdk/crt/s3/S3TcpKeepAliveOptions.class
software/amazon/awssdk/crt/s3/S3MetaRequestResponseHandlerNativeAdapter.class
software/amazon/awssdk/crt/auth/credentials/CredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/Credentials.class
software/amazon/awssdk/crt/auth/credentials/CachedCredentialsProvider$CachedCredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/CachedCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/CachedCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/CognitoCredentialsProvider$CognitoLoginTokenPair.class
software/amazon/awssdk/crt/auth/credentials/CognitoCredentialsProvider$CognitoCredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/CognitoCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/CognitoCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/StaticCredentialsProvider$StaticCredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/StaticCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/StaticCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/ProfileCredentialsProvider$Builder.class
software/amazon/awssdk/crt/auth/credentials/ProfileCredentialsProvider$BuilderImpl.class
software/amazon/awssdk/crt/auth/credentials/ProfileCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/ProfileCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/X509CredentialsProvider$X509CredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/X509CredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/X509CredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/DelegateCredentialsHandler.class
software/amazon/awssdk/crt/auth/credentials/StsCredentialsProvider$Builder.class
software/amazon/awssdk/crt/auth/credentials/StsCredentialsProvider$BuilderImpl.class
software/amazon/awssdk/crt/auth/credentials/StsCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/StsCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/StsWebIdentityCredentialsProvider$Builder.class
software/amazon/awssdk/crt/auth/credentials/StsWebIdentityCredentialsProvider$BuilderImpl.class
software/amazon/awssdk/crt/auth/credentials/StsWebIdentityCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/StsWebIdentityCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/DelegateCredentialsProvider$DelegateCredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/DelegateCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/DelegateCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/DefaultChainCredentialsProvider$DefaultChainCredentialsProviderBuilder.class
software/amazon/awssdk/crt/auth/credentials/DefaultChainCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/DefaultChainCredentialsProvider.class
software/amazon/awssdk/crt/auth/credentials/EcsCredentialsProvider$Builder.class
software/amazon/awssdk/crt/auth/credentials/EcsCredentialsProvider$BuilderImpl.class
software/amazon/awssdk/crt/auth/credentials/EcsCredentialsProvider$1.class
software/amazon/awssdk/crt/auth/credentials/EcsCredentialsProvider.class
software/amazon/awssdk/crt/auth/signing/AwsSigningConfig$AwsSigningAlgorithm.class
software/amazon/awssdk/crt/auth/signing/AwsSigningConfig$AwsSignatureType.class
software/amazon/awssdk/crt/auth/signing/AwsSigningConfig$AwsSignedBodyValue.class
software/amazon/awssdk/crt/auth/signing/AwsSigningConfig$AwsSignedBodyHeaderType.class
software/amazon/awssdk/crt/auth/signing/AwsSigningConfig.class
software/amazon/awssdk/crt/auth/signing/AwsSigningUtils.class
software/amazon/awssdk/crt/auth/signing/AwsSigner.class
software/amazon/awssdk/crt/auth/signing/AwsSigningResult.class
software/amazon/awssdk/crt/checksums/CRC32.class
software/amazon/awssdk/crt/checksums/CRC32C.class
software/amazon/awssdk/crt/CRT$1.class
software/amazon/awssdk/crt/CRT$UnknownPlatformException.class
software/amazon/awssdk/crt/CRT$2.class
software/amazon/awssdk/crt/CRT.class
software/amazon/awssdk/crt/CrtPlatform.class
software/amazon/awssdk/crt/utils/PackageInfo$Version.class
software/amazon/awssdk/crt/utils/PackageInfo.class
software/amazon/awssdk/crt/utils/ByteBufferUtils.class
software/amazon/awssdk/crt/utils/StringUtils.class
software/amazon/awssdk/crt/utils/PemUtils.class
software/amazon/awssdk/crt/mqtt/OnConnectionFailureReturn.class
software/amazon/awssdk/crt/mqtt/MqttClient.class
software/amazon/awssdk/crt/mqtt/MqttClientConnectionOperationStatistics.class
software/amazon/awssdk/crt/mqtt/OnConnectionSuccessReturn.class
software/amazon/awssdk/crt/mqtt/MqttClientConnectionEvents.class
software/amazon/awssdk/crt/mqtt/OnConnectionClosedReturn.class
software/amazon/awssdk/crt/mqtt/QualityOfService.class
software/amazon/awssdk/crt/mqtt/MqttMessage.class
software/amazon/awssdk/crt/mqtt/WebsocketHandshakeTransformArgs.class
software/amazon/awssdk/crt/mqtt/MqttClientConnection$MessageHandler.class
software/amazon/awssdk/crt/mqtt/MqttClientConnection$1.class
software/amazon/awssdk/crt/mqtt/MqttClientConnection.class
software/amazon/awssdk/crt/mqtt/MqttConnectionConfig.class
software/amazon/awssdk/crt/mqtt/MqttException.class
software/amazon/awssdk/crt/SystemInfo$CpuInfo.class
software/amazon/awssdk/crt/SystemInfo.class
software/amazon/awssdk/crt/Process.class
software/amazon/awssdk/crt/cal/EccKeyPair$AwsEccCurve.class
software/amazon/awssdk/crt/cal/EccKeyPair.class
META-INF/maven/software.amazon.awssdk.crt/aws-crt/pom.xml
META-INF/maven/software.amazon.awssdk.crt/aws-crt/pom.properties
linux/armv7/glibc/libaws-crt-jni.so
linux/armv7/musl/libaws-crt-jni.so
linux/armv8/musl/libaws-crt-jni.so
linux/x86_64/glibc/libaws-crt-jni.so
osx/armv8/cruntime/libaws-crt-jni.dylib
osx/x86_64/cruntime/libaws-crt-jni.dylib
windows/x86_32/cruntime/aws-crt-jni.dll

@DevTester888
Copy link
Author

The log

09-30 13:39:45.894  2036  2036 D AwsIotDeviceService: >> msg OS Name:Linux
09-30 13:39:45.895  2036  2036 D AwsIotDeviceService: >> msg systemPropertyOverride:null
09-30 13:39:45.895  2036  2036 D AwsIotDeviceService: >> msg environmentOverride:null
09-30 13:39:45.895  2036  2036 D AwsIotDeviceService: >> msg arch Name:aarch64
09-30 13:39:45.895  2036  2036 D AwsIotDeviceService: >> msg lib Name:libaws-crt-jni.so

The logic of code

final String CRT_ARCH_OVERRIDE_SYSTEM_PROPERTY = "aws.crt.arch";
final String CRT_ARCH_OVERRIDE_ENVIRONMENT_VARIABLE = "AWS_CRT_ARCH";
final String CRT_LIB_NAME = "aws-crt-jni";

String osName = System.getProperty("os.name");
Log.d(TAG, ">> msg " + "OS Name:" + osName);

String systemPropertyOverride = System.getProperty(CRT_ARCH_OVERRIDE_SYSTEM_PROPERTY);
Log.d(TAG, ">> msg " + "systemPropertyOverride:" + systemPropertyOverride);

String environmentOverride = System.getenv(CRT_ARCH_OVERRIDE_ENVIRONMENT_VARIABLE);
Log.d(TAG, ">> msg " + "environmentOverride:" + environmentOverride);

String archName = System.getProperty("os.arch");
Log.d(TAG, ">> msg " + "arch Name:" + archName);

String libraryName = System.mapLibraryName(CRT_LIB_NAME);
Log.d(TAG, ">> msg " + "lib Name:" + libraryName);

@bretambrose
Copy link
Contributor

It looks like you're using aws-iot-device-sdk, which does not have Android support. Per the Android instructions, you should be consuming aws-iot-device-sdk-android.

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Sep 30, 2024
@DevTester888
Copy link
Author

@bretambrose

I try to replace to
implementation 'software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk-android:1.21.0'

And I get the error.
`

  • What went wrong:
    Execution failed for task ':app:stripVanillaReleaseDebugSymbols'.

No version of NDK matched the requested version 20.0.5594570. Versions available locally: 16.1.4479499, 21
.3.6528147, 24.0.8215888, 25.1.8937393
`

Does it possible support the other NDK version?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Oct 4, 2024
@sbSteveK
Copy link
Contributor

We do not request version 20.0.5594570 of the NDK anywhere. NDK is used to compile native code and there is no native C code to be built in aws-iot-device-sdk-java-v2. If you are consuming the sdk as instructed here: https://github.com/aws/aws-iot-device-sdk-java-v2/blob/main/documents/ANDROID.md#consuming-from-maven there is no need for NDK related to this SDK.

aws-crt-java, which aws-iot-device-sdk-java-v2 depends on, uses NDK 21.4.7075529 but that shouldn't be relevant here but is further evidence that your current issue is not related to aws-iot-device-sdk-java-v2.

I suggest you find out what is requesting that specific version of an NDK (it'll probably be some part of your code that contains native C) and working out whether you can modify it safely to use a different version of the NDK than it is requesting.

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Oct 11, 2024
@DevTester888
Copy link
Author

@sbSteveK
It's looks like the NDK 20.0.5594570 is necessary while gradle build. I create a virtual environment and install NDK 20.0.5594570. The project-build is successfully.

And it's always shown if no NDK 20.0.5594570
No version of NDK matched the requested version 20.0.5594570. Versions available locally: 16.1.4479499, 21
.3.6528147, 24.0.8215888, 25.1.8937393

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Oct 15, 2024
@DevTester888
Copy link
Author

DevTester888 commented Oct 15, 2024

Install & run with the apk with the solution #598 (comment). I get this crash.

10-15 13:09:43.047 4718 4718 E _device_servic: Dex checksum does not match for dex: /system/app/AWSIoTCoreService/AWSIoTCoreService.apk.Expected: 2863585491, actual: 733831269
10-15 13:09:43.133 4718 4718 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4718 (_device_service), pid 4718 (_device_service)
10-15 13:09:43.501 4741 4741 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-15 13:09:43.501 4741 4741 F DEBUG : Build fingerprint: 'xxxxxxxxxxxxx'
10-15 13:09:43.502 4741 4741 F DEBUG : Revision: '0'
10-15 13:09:43.502 4741 4741 F DEBUG : ABI: 'arm64'
10-15 13:09:43.503 4741 4741 F DEBUG : Timestamp: 2024-10-15 13:09:43+0700
10-15 13:09:43.503 4741 4741 F DEBUG : pid: 4718, tid: 4718, name: _device_service >>> com.OOOOO.android.aws_iot_device_service <<<
10-15 13:09:43.503 4741 4741 F DEBUG : uid: 1010029
10-15 13:09:43.503 4741 4741 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
10-15 13:09:43.503 4741 4741 F DEBUG : x0 0000000000000000 x1 000000000000126e x2 0000000000000006 x3 0000007fc241fd90
10-15 13:09:43.503 4741 4741 F DEBUG : x4 676e69746978450a x5 676e69746978450a x6 676e69746978450a x7 6163696c70704120
10-15 13:09:43.503 4741 4741 F DEBUG : x8 00000000000000f0 x9 a202b479b1e24cfd x10 0000000000000001 x11 0000000000000000
10-15 13:09:43.503 4741 4741 F DEBUG : x12 fffffff0fffffbdf x13 0a6e6f6974616369 x14 0000000000000010 x15 0000007cde15d40a
10-15 13:09:43.503 4741 4741 F DEBUG : x16 0000007cde1638c0 x17 0000007cde1410d0 x18 0000007cdfe1e000 x19 000000000000126e
10-15 13:09:43.503 4741 4741 F DEBUG : x20 000000000000126e x21 00000000ffffffff x22 0000007cde15d620 x23 0000007bf2cd1085
10-15 13:09:43.503 4741 4741 F DEBUG : x24 0000000000000000 x25 0000007cdf656020 x26 0000007cdf367cb0 x27 0000000000000000
10-15 13:09:43.504 4741 4741 F DEBUG : x28 0000007fc241ffa0 x29 0000007fc241fe30
10-15 13:09:43.504 4741 4741 F DEBUG : sp 0000007fc241fd70 lr 0000007cde0f5f48 pc 0000007cde0f5f74
10-15 13:09:43.712 795 963 E Sll-If-Lib-Impl: [sendMsgToIzat] Error in Write, socket: 14, MSG-Type 131, Error No such file or directory
10-15 13:09:43.712 795 963 E Sll-If-Lib-Impl: [sllIzatRequestEedGpsFile] Error: Send Msg
10-15 13:09:43.712 795 963 E Sll-If-Lib-Impl: [sendMsgToIzat] Error in Write, socket: 14, MSG-Type 132, Error No such file or directory
10-15 13:09:43.713 795 963 E Sll-If-Lib-Impl: [sllIzatRequestEedGloFile] Error: Send Msg
10-15 13:09:43.790 4741 4741 F DEBUG :
10-15 13:09:43.790 4741 4741 F DEBUG : backtrace:
10-15 13:09:43.791 4741 4741 F DEBUG : #00 pc 0000000000081f74 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 74c5cea844544c64994cc6243fb13d25)
10-15 13:09:43.791 4741 4741 F DEBUG : #1 pc 00000000002cc89c /system/app/AWSIoTCoreService/AWSIoTCoreService.apk!libaws-crt-jni.so (offset 0x1b5000) (aws_fatal_assert+80) (BuildId: 28f381564661c84a916d92d47e7b76da878c9bfd)
10-15 13:09:43.791 4741 4741 F DEBUG : #2 pc 000000000009696c /system/app/AWSIoTCoreService/AWSIoTCoreService.apk!libaws-crt-jni.so (offset 0x1b5000) (BuildId: 28f381564661c84a916d92d47e7b76da878c9bfd)
10-15 13:09:43.791 4741 4741 F DEBUG : #3 pc 00000000000e26d4 /apex/com.android.runtime/lib64/bionic/libc.so (pthread_once+148) (BuildId: 74c5cea844544c64994cc6243fb13d25)
10-15 13:09:43.791 4741 4741 F DEBUG : #4 pc 00000000002dcfc8 /system/app/AWSIoTCoreService/AWSIoTCoreService.apk!libaws-crt-jni.so (offset 0x1b5000) (aws_thread_call_once+100) (BuildId: 28f381564661c84a916d92d47e7b76da878c9bfd)
10-15 13:09:43.791 4741 4741 F DEBUG : #5 pc 00000000000a8450 /system/app/AWSIoTCoreService/AWSIoTCoreService.apk!libaws-crt-jni.so (offset 0x1b5000) (Java_software_amazon_awssdk_crt_io_TlsContextOptions_tlsContextOptionsIsAlpnAvailable+8) (BuildId: 28f381564661c84a916d92d47e7b76da878c9bfd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants