0

My app is for view images When user click on next button show next image or back button show the previous image, the problem started When I tried to run the project I see some error about images size

"The file is too large; 80.83M. Showing a read-only of the first 2.56M".


I tried this solution the privous message is disappered but I still see some errors

Error:error: failed to read data meta data.
Error:failed parsing overlays.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

The first error

enter image description here

The second error

enter image description here

Dr Mido
  • 2,414
  • 4
  • 32
  • 72

2 Answers2

1

1) Write android:largeHeap="true" in your manifest under application.

2) Go to File -> Invalidate caches/restart -> Just restart. This will clear all caches.

3) Go to Build -> Clean project

4) Go to Build -> Rebuild project

0

Why do you need a PNG this big? A good practice is to keep your APK size as small as possible, with a reasonable size for an app like yours around 4MB. Even if you crunch these PNG images they will still be way too big and result in a huge size of your APK.

According to the Android Developers' guide:

Users often avoid downloading apps that seem too large, particularly in emerging markets where devices connect to often-spotty 2G and 3G networks or work on pay-by-the-byte plans.

More info: here

Izabela Orlowska
  • 7,431
  • 2
  • 20
  • 33
  • thank you for information, but this app is for education purpose, in the real project I'll use JPEG instead of PN – Dr Mido Mar 23 '18 at 17:20