How to Add Stacktrace or Debug Option When Building Android Studio Project

How to Add Stacktrace or debug Option when Building Android Studio Project

You can use GUI to add these gradle command line flags from

File > Settings > Build, Execution, Deployment > Compiler

For MacOS user, it's here

Android Studio > Preferences > Build, Execution, Deployment > Compiler

like this (add --stacktrace or --debug)

Sample Image

Note that the screenshot is from before 0.8.10, the option is no longer in the Compiler > Gradle section, it's now in a separate section named Compiler (Gradle-based Android Project)

How to Run with --stacktrace option to get the stack trace

You can try running the assembleDebug Gradle task manually.

cd android
./gradlew assembleDebug --stacktrace

But there could be something wrong with your configuration.
Run flutter doctor -v and see if everything is setup correctly.

Otherwise you can try deleting the Gradle cache folder which seem to bet at C:\Users\October Price.gradle\caches.

Unable to run Flutter Project with Package

For those who came up with the same problem I have. The project I'm working came from Git and I think that project wasn't updated for Android Embedding v2 so I got the first error.

Now in the second error, all I did was to read other's bug fixes (not officially).

  1. Adding the dependencies and kotlin-version (1.4.20) needed for the main package(audioplayers). C:\flutter\flutter.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\

    Sample Image
  2. Making the android project's app build.gradle>defaultConfig>minSdkVersion to 23 (from 16)
    Sample Image
  3. Use pub get and update in pubspec.yaml.

How to run compile debug stacktrace in Android studio

news_center-body_text

This has an error at - (the arrow is pointing to it).

Your resource names must reflect valid Java variable rules, so no - characters. Change it to an _ in the ID for that XML element where you have that particular element.


On a related note - How would you expect findViewById(R.id.news_center-body_text) to work?

That would be your first hint that something is wrong.



Related Topics



Leave a reply



Submit