0

I'm trying to build my first signed APK for release and I got some error. It seems that work perfectcly but now I just cant generate APK. I've done research but couldn't find anything.

Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

Gradle version: 4.8, Android Plugin Version 3.1.4 and here's my app gradle screenshot: link

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

This is from assembleDebug:

Configuration on demand is an incubating feature.
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)


27 actionable tasks: 1 executed, 26 up-to-date

I used to have other problems with layout and deprecated functions but I fixed it. One of them just disappear but I had done nothing :-)

unchecked call to execute
new getToken().execute();
where Params,Progress,Result are type-variables:
Params extends Object declared in class AsyncTask
Progress extends Object declared in class AsyncTask
Result extends Object declared in class AsyncTask

Things that I have already tried:

1. android.enableAapt2=false
2. checked if strings (for character i.e. chinese)
3. added classpath ('com.google.firebase:firebase-plugins:1.1.0') {
        exclude group: 'com.google.guava', module: 'guava-jdk5'
    }


and many more but NOTHING! Same error -.-
  • 1
    Possible duplicate of [Gradle Warnings: Could not find google-services.json while looking in](https://stackoverflow.com/questions/47565761/gradle-warnings-could-not-find-google-services-json-while-looking-in) – ʍѳђઽ૯ท Sep 09 '18 at 15:43

2 Answers2

1

Check your PNG images, corrupted maybe or not real png (jpeg for example)

You can get the list of unreal PNGs by typing following command in android terminal

find . -type f -name "*.png" | xargs -L 1 -I{} file  -I {} | grep -v 'image/png; charset=binary$'
Anubhav Gupta
  • 2,492
  • 14
  • 27
0

Could not find google-services.json while looking in

Probably your project needs google-services.json. Place the file in /app folder of project.

Since you are using FireBase, you may be forgotten to place the file in there and placing the file from FireBase console in there will help.

Check this out: https://stackoverflow.com/a/40800682/4409113

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108