1

I'm using google service gradle

compile 'com.google.android.gms:play-services:8.1.0'
=> Bitmap bitmap = BitmapFactory.decodeFile(imagePath); // return bitmap

when i upgrade it to

compile 'com.google.android.gms:play-services-ads:8.4.0'
=> Bitmap bitmap = BitmapFactory.decodeFile(imagePath); // return null ??!!

Why was that happen ? and what is the solution ?

Ahmed Mohammed
  • 337
  • 3
  • 16

1 Answers1

0
i am using same gradle
compile 'com.google.android.gms:play-services-ads:8.4.0'
i am sure issue is with your file path
check below code for testing put an image test.jpg in your DCIM folder and run this code
ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
            String imageInSD = "/sdcard/DCIM/test.jpg";            
            Bitmap bitmap = BitmapFactory.decodeFile(imageInSD);
            if(bitmap == null){
                Toast.makeText(getActivity(),"not found",Toast.LENGTH_SHORT).show();
            }
            else {
                Toast.makeText(getActivity(),"found",Toast.LENGTH_SHORT).show();
                imageView.setImageBitmap(bitmap);
            }
Khizar Hayat
  • 3,427
  • 3
  • 18
  • 22
  • Thank you but, when i upgrade compile 'com.google.android.gms:play-services:8.1.0' into 8.4.0 i have this problem http://stackoverflow.com/questions/34400059/android-studio-gradle-org-gradle-process-internal-execexception – Ahmed Mohammed Feb 25 '16 at 13:17