title: Android - Upload Image in a Azure Container
body: <p>I have used the following code to upload image in a storage container in azure from android. It throws the error on "// Create the blob client" line. some java.lang.verifyError. I have searched to solve this error but i can't find any solution.</p>
  
  <pre><code>String connectionString = "DefaultEndpointsProtocol=https;AccountName=StorageAccountName;AccountKey=StorageAccountKey"
  
  CloudStorageAccount storageAccount = CloudStorageAccount.parse(connectionString);
  
  // Create the blob client
  CloudBlobClient blobClient = storageAccount.createCloudBlobClient();
  
  // Get a reference to a container
  // The container name must be lower case
  CloudBlobContainer container = blobClient.getContainerReference("images");
  
  // Create the container if it does not exist
  container.createIfNotExists();
  
  // Create a permissions object
  BlobContainerPermissions containerPermissions = new BlobContainerPermissions();
  
  // Include public access in the permissions object
  containerPermissions.setPublicAccess(BlobContainerPublicAccessType.CONTAINER);
  
  // Set the permissions on the container
  container.uploadPermissions(containerPermissions);
  
  // Create or overwrite the "myimage.jpg" blob with contents from a local file
  CloudBlockBlob blob = container.getBlockBlobReference("myimageYdolo.jpg");
  File source = new File(currImageURI.toString());
  blob.upload(new FileInputStream(source), source.length());
  </code></pre>
  
  <p>Here is the error i have got:</p>
  
  <pre><code>08-16 14:48:15.045: W/dalvikvm(5579): VFY: unable to find exception handler at addr 0x2b
  08-16 14:48:15.045: W/dalvikvm(5579): VFY:  rejected Lcom/microsoft/azure/storage/ServiceClient;.uploadServicePropertiesImpl (Lcom/microsoft/azure/storage/ServiceProperties;Lcom/microsoft/azure/storage/RequestOptions;Lcom/microsoft/azure/storage/OperationContext;Z)Lcom/microsoft/azure/storage/core/StorageRequest;
  08-16 14:48:15.045: W/dalvikvm(5579): VFY:  rejecting opcode 0x0d at 0x002b
  08-16 14:48:15.045: W/dalvikvm(5579): VFY:  rejected Lcom/microsoft/azure/storage/ServiceClient;.uploadServicePropertiesImpl (Lcom/microsoft/azure/storage/ServiceProperties;Lcom/microsoft/azure/storage/RequestOptions;Lcom/microsoft/azure/storage/OperationContext;Z)Lcom/microsoft/azure/storage/core/StorageRequest;
  08-16 14:48:15.045: W/dalvikvm(5579): Verifier rejected class Lcom/microsoft/azure/storage/ServiceClient;
  08-16 14:48:15.045: D/AndroidRuntime(5579): Shutting down VM
  08-16 14:48:15.045: W/dalvikvm(5579): threadid=1: thread exiting with uncaught exception (group=0x41dc6ba8)
  08-16 14:48:15.045: E/AndroidRuntime(5579): FATAL EXCEPTION: main
  08-16 14:48:15.045: E/AndroidRuntime(5579): Process: com.example.azuretry, PID: 5579
  08-16 14:48:15.045: E/AndroidRuntime(5579): java.lang.VerifyError: com/microsoft/azure/storage/ServiceClient
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at com.microsoft.azure.storage.CloudStorageAccount.createCloudBlobClient(CloudStorageAccount.java:715)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at com.example.azuretry.FullscreenActivity.onActivityResult(FullscreenActivity.java:144)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.Activity.dispatchActivityResult(Activity.java:5423)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3347)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3394)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.ActivityThread.access$1300(ActivityThread.java:135)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.os.Handler.dispatchMessage(Handler.java:102)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.os.Looper.loop(Looper.java:136)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at android.app.ActivityThread.main(ActivityThread.java:5001)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at java.lang.reflect.Method.invoke(Method.java:515)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  08-16 14:48:15.045: E/AndroidRuntime(5579):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>