Skip to content

UTbot cannot build Android Studio project #994

@tyuldashev

Description

@tyuldashev

Description

When UTBot tries to generate tests in Android Studio for typical project it fails due inability to 'understand' Android specific, e.g. resolve R.java file.

To Reproduce

Steps to reproduce the behavior:

  1. Install latest Android Studio with default settings. I've checked with 2021.3.1, copy could be downloaded from Onebox
  2. Start new Project wizard
  3. Select 'Phone and Tablet' template and 'Basic Activity'
  4. On next step select 'Java' as language, everything else leave default.
    image
  5. Finish wizard and wait Gradle and IDEA sync and update the project
  6. Try to generate tests for com.example.myapplication.MainActivity with default UTBot settings

Expected behavior

Tests are generated

Actual behavior

Build error happens with reported problems like:
package com.example.myapplication.databinding does not exist
package R does not exist

Visual proofs (screenshots, logs, images)

image

Additional context

Gradle is able to build and run the app.

Metadata

Metadata

Assignees

Labels

ctg-enhancementNew feature, improvement or change requeststatus-verifiedBug fix is verified

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions