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

SDK doesn't compile with aws-crt 0.5.7 #69

Closed
2 tasks done
AmeliaMcMullen opened this issue Jun 18, 2020 · 24 comments
Closed
2 tasks done

SDK doesn't compile with aws-crt 0.5.7 #69

AmeliaMcMullen opened this issue Jun 18, 2020 · 24 comments
Labels
guidance Question that needs advice or information.

Comments

@AmeliaMcMullen
Copy link

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Known Issue

  • I'm using ATS data type endpoint: the endpoint should look like <prefix>-ats.iot.<region>.amazonaws.com

Describe the bug
This is the stack trace from running the application:

    io.reactivex.exceptions.UndeliverableException: java.lang.UnsatisfiedLinkError: No implementation found for void software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean) (tried Java_software_amazon_awssdk_crt_CRT_awsCrtInit and Java_software_amazon_awssdk_crt_CRT_awsCrtInit__IZ)
        at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)

This is the stack trace from trying to build the SDK with the new aws-crt version:

> Task :iotdevicesdk:compileReleaseJavaWithJavac FAILED
/Users/alyman/aws-iot-device-sdk-java-v2/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java:449: error: cannot find symbol
                    signingConfig.setAlgorithm(AwsSigningConfig.AwsSigningAlgorithm.SIGV4);
                                                                                   ^
  symbol:   variable SIGV4
  location: class AwsSigningAlgorithm
/Users/alyman/aws-iot-device-sdk-java-v2/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java:450: error: cannot find symbol
                    signingConfig.setSignatureType(AwsSigningConfig.AwsSignatureType.HTTP_REQUEST_VIA_QUERY_PARAMS);
                                                                   ^
  symbol:   variable AwsSignatureType
  location: class AwsSigningConfig
/Users/alyman/aws-iot-device-sdk-java-v2/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java:454: error: cannot find symbol
                    signingConfig.setOmitSessionToken(true);
                                 ^
  symbol:   method setOmitSessionToken(boolean)
  location: variable signingConfig of type AwsSigningConfig
3 errors

FAILURE: Build failed with an exception.

SDK version number
SDK number: 0.5.7

Platform/OS/Hardware/Device
Samsung galaxy S9 - Oreo

To Reproduce (observed behavior)
To reproduce the first stack trace: Update the aws-crt version to 0.5.7 and try to run a sample application.
To reproduce the second stack trace: Update the build.gradle aws-crt version to 0.5.7 for iotdevicesdk and build the project.

Expected behavior
No error when running an application with the 0.5.7 version.

Logs/output
See above.

To enable logging, set the following system properties:

REMEMBER TO SANITIZE YOUR PERSONAL INFO

-Daws.crt.debugnative=true
-Daws.crt.log.destination=File
-Daws.crt.log.level=Trace
-Daws.crt.log.filename=<path and filename>

Additional context
Still trying to get proxy to work with the X509CredentialsProvider.

@AmeliaMcMullen AmeliaMcMullen added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 18, 2020
@bretambrose
Copy link
Contributor

It looks like you're trying to build the latest SDK with an older CRT. The latest SDK requires a crt version of at least 0.6.0 from a binary compatibility standpoint (the actual depdendency is 0.6.2 right now).

@bretambrose bretambrose added guidance Question that needs advice or information. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 18, 2020
@AmeliaMcMullen
Copy link
Author

AmeliaMcMullen commented Jun 18, 2020

@bretambrose When I looked at the build.gradle file for the SDK project I have checked out the CRT version is 0.5.4 so I thought it was okay. This is also the same SDK project I used with CRT 0.5.6 that worked fine. Is there a link you can give me for the correct SDK?

@bretambrose
Copy link
Contributor

Ah the gradle config hasn't been updated since the initial android build work was completed. For now, you can use the pom.xml to figure out the needed version (1.2.2 SDK requires 0.6.2 crt). I'll update the gradle file and make a new release asap.

@AmeliaMcMullen
Copy link
Author

Thanks for updating the CRT version. I pulled the latest and saw that it was fixed. One other thing that's giving me issues is the newer version of CRT has a different artifact ID when I run the commands for Android on this page. What you have in the gradle file is: android:0.6.2 but I'm finding it needs to be aws-crt:0.6.2. Is this something I'm doing wrong or should this be updated?

With the latest SDK checked out and CRT version 0.6.2, I am still not able to run my application. I still get the following error:

    io.reactivex.exceptions.UndeliverableException: java.lang.UnsatisfiedLinkError: No implementation found for void software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean) (tried Java_software_amazon_awssdk_crt_CRT_awsCrtInit and Java_software_amazon_awssdk_crt_CRT_awsCrtInit__IZ)
        at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean) (tried Java_software_amazon_awssdk_crt_CRT_awsCrtInit and Java_software_amazon_awssdk_crt_CRT_awsCrtInit__IZ)
        at software.amazon.awssdk.crt.CRT.awsCrtInit(Native Method)
        at software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:49)
        at software.amazon.awssdk.crt.CrtResource.<clinit>(CrtResource.java:104)
        at com.a.b.c.MyService.connectWithNewStuff(MygService.java:547)
        at com.a.b.c.MyService.connect(MyService.java:411)
        at com.a.b.c.-$$Lambda$QGvInWxgQaux-XIMYYPhle8KTFw.run(Unknown Source:2)
        at com.a.b.c.MyService.lambda$wrap$0(MyService.java:441)
        at com.a.b.c.-$$Lambda$MyService$knrcCIKmsULdFEyFPCA7CjogF58.call(Unknown Source:2)
        at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
        at io.reactivex.Single.subscribe(Single.java:3096)
        at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:571)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
        at java.lang.Thread.run(Thread.java:764) 

@bretambrose
Copy link
Contributor

We've updated the android build process. Can you give it another go and let us know if it solves your issue?

@AmeliaMcMullen
Copy link
Author

I pulled the latest from aws-iot-device-sdk-java-v2 repo on master and rebuilt the SDK. I am still having the same issue.

Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean) (tried Java_software_amazon_awssdk_crt_CRT_awsCrtInit and Java_software_amazon_awssdk_crt_CRT_awsCrtInit__IZ)

@bretambrose
Copy link
Contributor

bretambrose commented Jun 22, 2020

Does this affect all platforms (local) or just when you run it on a device? What about the emulator?

Can you paste

  1. the build output from when you built the crt
  2. the contents (file wise) of the resulting aws-crt jar file you are building and using, ideally as it exactly appears in the final android apk. If this is happening for local platform builds too, then just the local jar contents is fine.
  3. if possible (it may not be) a description of the branchwise execution within loadLibraryFromJar(): https://github.com/awslabs/aws-crt-java/blob/master/src/main/java/software/amazon/awssdk/crt/CRT.java#L129 (unfortunately, the logging system isn't initialized yet and can't help here)

With respect to (3), I worry that since loadLibraryFromJar swallows all exceptions, we may have a load failure that is masquerading as a runtime bind failure.

@AmeliaMcMullen
Copy link
Author

While trying to get the information you wanted I noticed this in my local maven repo and I'm wondering if this is the issue:
Screen Shot 2020-06-22 at 12 09 40 PM
Names/versions for CRT that it's building are all null. The aar and pom it generates also have "null" in the name.

@AmeliaMcMullen
Copy link
Author

Just to see if it would work, I renamed all the "null.null.null" things to be 0.6.2. I noticed that the SDK destination also changed in the local repository folder. It used to be "awssdk.iotdevicesdk" but is now "awssdk.crt.iotdevicesdk" and the version used to be 1.0.0-SNAPSHOT but is now 1.0-SNAPSHOT. I fixed all those things and I'm still having the same problem.

  1. crtBuildOutput.txt
  2. There is no jar file that gets built. There is an aar file and a pom file. I zipped up the android folder that is generated in my local repository after running the command for CRT. (Zipped after I renamed folders/files to be 0.6.2 instead of null.null.null)
    android.zip
  3. I'm not sure what you mean by this.

@bretambrose
Copy link
Contributor

Our Android expert is out today; I'll see if he's able to take a look when he gets back in tomorrow.

@AmeliaMcMullen
Copy link
Author

@bretambrose Any updates on this?

@AmeliaMcMullen
Copy link
Author

@bretambrose Anything new with this?

@bretambrose
Copy link
Contributor

I've forwarded this to Justin, he should be able to take a look soon.

@justinboswell
Copy link
Contributor

I'm taking a look now.

@justinboswell
Copy link
Contributor

justinboswell commented Jun 26, 2020

In order to get that output with nulls in it, git would have to be inaccessible from your build system. Is that the case?

@AmeliaMcMullen
Copy link
Author

No, that shouldn't be the case. I've built previous versions the same way. CRT version 0.5.6 and 0.5.7 worked and generated the correct files/folders. Pulling the latest is when I've started seeing the issues

@justinboswell
Copy link
Contributor

Ok, I've done a clean build from scratch on both, with an empty maven repo locally. I fixed up the references between the CRT and IoT Device SDK packages in the above PR. Feel free to pull it and test, I have others at AWS testing as well just to make sure.

Once this is merged, I'll do a new release of this library. No changes are required to the CRT package.

@justinboswell
Copy link
Contributor

Ok, the PR is merged, I'll start a release. Note that the group/artifact has changed for the android package to be consistent with other platforms, it is now software.amazon.awssdk.iotdevicesdk:android

@justinboswell
Copy link
Contributor

@AmeliaMcMullen
Copy link
Author

Thanks for your help. Pulling the sdk from maven is much easier. I'm still having the same issue, however.

Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void software.amazon.awssdk.crt.CRT.awsCrtInit(int, boolean) (tried Java_software_amazon_awssdk_crt_CRT_awsCrtInit and Java_software_amazon_awssdk_crt_CRT_awsCrtInit__IZ)

Previously we had dependencies for SDK and CRT (I think we had to for some reason but I'm not entirely sure why) and now I have only this for my dependency:
implementation 'software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk:1.2.4'
I saw you mentioned the group/artifact ends with :android but that did not work when I put it in so I matched the dependency with this page
This seems to compile but when I run it, I still get the same error. Do I still need to import CRT separately? Farther up in the logs I came across something I didn't notice before. I see this error:

W/System.err: Unable to unpack AWS CRT lib: java.io.IOException: Unable to open library in jar for AWS CRT: /android/arm64-v8a/libaws-crt-jni.so
W/System.err: java.io.IOException: Unable to open library in jar for AWS CRT: /android/arm64-v8a/libaws-crt-jni.so

@AmeliaMcMullen
Copy link
Author

AmeliaMcMullen commented Jun 29, 2020

Small followup: I added the CRT dependency as well and I'm still seeing the same error:

        implementation 'software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk:1.2.4'
        implementation 'software.amazon.awssdk.crt:aws-crt:0.6.2'

Found the CRT dependency from this page

I also had another developer try and he is seeing the same error.

@bretambrose bretambrose reopened this Jun 29, 2020
@bretambrose
Copy link
Contributor

My impression was that this was resolved last week via call. Please reopen if there is still an issue.

@rajkumu12
Copy link

rajkumu12 commented Jul 28, 2020

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve software.amazon.awssdk.crt:android:0.6.2.
I downloaded the same project from github still this issue

@AngelHadzhiev
Copy link

I have the same issue, was any solution found for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

5 participants