Compiling Android Release APK Issue – Lint found fatal errors while assembling a release target

This is a summation of what is displayed in your Build Output pane in Android Studio.

Build Output - Fatal Error
Lint found fatal errors while assembling a release target.
To proceed, either fix the issues identified by lint, or modify your build script as follows:

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

WARNING – The method listed above will work but it is NOT best practice!

It’s better to examine the auto generated report which is an excellent resource created by Android Studio that I always forget about. 

Report location

<project_root>/android/app/build/reports/lint-results-release-fatal.html

Screenshot of the report

We can see from the screenshots, namely the first one, there’s a problem in the NativeJSPlayer class. It was looking for an argument free public constructor, i.e.,

// Needed to avoid lint error when building release apk
public NativeJWPlayer(){}

Full Example

public class NativeJWPlayer extends AppCompatActivity {
     public NativeJWPlayer(){}

     public NativeJWPlayer(String videoURL) {
          mVidURL = videoURL;
     }
}

See the first screenshot for a better explanation but essentially activities that are registered in the manifest must be declared as “instantiable”, which means the activity parent class must be public and it must have an empty public constructor.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x