-
Notifications
You must be signed in to change notification settings - Fork 549
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
v2.0.5 ExceptionInInitializerError #2
Comments
I just saw this line before the exception:
|
I found and solve the issue. |
Hey niqo01, I really appreciate you posting the issue and fix! Would you be able to give us an example of how you were initializing the Transfer Manager. This issue never came up in our testing and I'd like to learn why so we can fix it for our future releases. I'm assuming you were also using version 2.0.5 of S3? Thanks, |
Yes, I am also using 2.0.5 of S3 . My test code looks like this
The code crashed directly at the TransferManager creation |
Hi, thanks for helping us improve the SDK! We aren't able to reproduce this issue so it would be awesome if you could provide us with a few more details. Namely,
Thanks again! |
|
Hey niqo01, |
@ma-hussain The fix which worked for me is to:
|
@niqo01 I have removed the commented lines but still I am getting errors. Can you explain what was wrong with the comment in awssdk_config_default.json file and why just removing a comment in the file worked for you ?? 08-06 18:26:31.650: I/VersionInfoUtils(20672): Unable to load version information for the running SDK: /com/amazonaws/sdk/versionInfo.properties not found on classpath E/AndroidRuntime(19831): FATAL EXCEPTION: main |
@ma-hussain just copy the content of the Also you can read here more about comment in json file: http://stackoverflow.com/questions/244777/can-i-comment-a-json-file |
@ma-hussain If you are using proguard can you post your proguard config? Also we are looking into this json file issue. |
Let me explain my issue properly... I need to use S3 in my mobile app which is built using Adobe Flex and we are accessing all the native java android feature by creating ActionScript Native Extensions(ANE) which allows me incorporate native platform capabilities into my application and use them like standard libraries.. So, I downloaded the S3 java android sample executed it and it is working fine, I can upload/download my files to/from my S3 bucket. I included aws-android-sdk-2.0.5-s3.jar and aws-android-sdk-2.0.5-core.jar into the libs folder and everything is working fine. But when I am merging the code with my Java ANE , I am using the the aws-sdk core and s3 jar. It is compiling without any errors, I create the ANE from it and add it to my Flex app but when I run my Flex app ,it is giving me those errors just when initializing TransferManager.. |
Hey ma-hussain, We've seen a number of cross-platform development tools strip out non-java files from jars in the past. It looks to me like Flex is stripping these files out of our SDK jars. Can you verify if this is the case, and if so see if Flex provides an options for not stripping out these files? Thanks, |
@wdane May be you are correct . But I have not yet come across a solution to stop Flex from stripping the non-java files. I am still working on it. By the way can you tell me whether any AWS S3 sdk is available for Adobe Flex. |
@ma-hussain Unfortunately we do not currently support Adobe Flex, the AWS article is not specifically targeting mobile developers using our SDK. The second link is not something that has been produced by Amazon so I cannot help in that regard. However another customer has had a similar issue and has provided detailed steps as to how to get around it. He is using Adobe Air, but the solutions should be relatively universal for cross compilers stripping out non-java files. https://forums.aws.amazon.com/thread.jspa?messageID=562833򉚑 |
@wdane Hey Weston , |
@ma-hussain |
To use Amazon S3 for Adobe Flex/Action Script mobile app using JAVA ANE, follow the following procedure. You must have prior knowledge on how to create ANE(Air Native Extension). But before going through the below steps I suggest you go through this link 1.) First of all copy the 'fasterxml' folder inside the 'com' folder of your ANENative project by using Windows explorer.
If you want to reproduce the same error you can skip this step. This will help you understand the reason I needed this 'fasterxml' folder. 2.)After your java android ANENative project is ready with all the S3 code with the 'aws-android-sdk-2.0.5-core.jar' and 'aws-android-sdk-2.0.5-s3.jar' inside the libs folder, export your ANENative project to a jar file say ANENative.jar . 3.)After step 2, we need to extract 'aws-android-sdk-2.0.5-core.jar' and 'aws-android-sdk-2.0.5-s3.jar' into 2 different folders. If you dont have the above jar files, download it from this link - > 'http://aws.amazon.com/sdk-for-android/' copy the ANENative.jar file to the folder containing the extracted "aws-android-sdk-2.0.5-core" package and files from 'aws-android-sdk-2.0.5-core.jar' library and run the following commands
3.) copy the modified ANENative.jar file to the folder containing the extracted "aws-android-sdk-2.0.5-s3" package and files from 'aws-android-sdk-2.0.5-s3.jar' library and run the following commands
4.)Now use this 'ANENative.jar' to create the ANE. 5.)Add the created ANE to build path Native Extensions of your Adobe Flex mobile project. 6.)Export the release build using the regular technique by Adobe Flash Builder to get the .apk file 7.)IMPORTANT: Now from the extracted folders of the 'aws-android-sdk-2.0.5-core.jar' and 'aws-android-sdk-2.0.5-s3.jar' file remove all the non-class files and keep the remaining files in another seperate folder with the package structure intact.
file)
therefore opted to add them using WINRAR as described in Step iv 8.)Remove the previous signing bits, 'aapt remove ' for CERT.RSA, 'CERT.SF, MANIFEST.MF in META-INF
9.) Resign the apk with 'jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ' 10.)Realign the apk with zipalign 'zipalign -v 4 <apk_prealign> ' NOW WE ARE DONE. Install the apk and Amazon S3 should work now Hope this may help someone who needs to use Amazon S3 using Flex mobile app |
Would like to thank everyone for contributing all of their experiences and help. Closing the issue, as it seems like solid work-arounds have been found though we will be looking into making this easier in the future. |
We actually still get this error in a native Android app, even when ProGuard is disabled, using 2.1.7. Have you guys seen any more issues crop up with this? |
Version 2.0.5
I am having the following exception while creating a new TransferManager.
I don't know if its related but there some Dex warning while building the application
The text was updated successfully, but these errors were encountered: