Code Monkey home page Code Monkey logo

Comments (8)

nenick avatar nenick commented on July 22, 2024

I saw this message by a co worker. We could not explain why. There is a known issue but it didn't match. #4

Just close and reopen Android Studio helped.

from android-gradle-template.

DylanSale avatar DylanSale commented on July 22, 2024

We found closing and re-opening worked sometimes, but not others. Deleting the .idea folder and iml files and re-importing the project worked consistently, but is a pain to do.

from android-gradle-template.

DylanSale avatar DylanSale commented on July 22, 2024

EDIT: This is not correct

I think I figured out what it is. The first (ExampleProject below) element in the .idea/workspace.xml file is causing the problem:

              <ExternalProjectPojo>
                <option name="name" value="ExampleProject" />
                <option name="path" value="$PROJECT_DIR$" />
              </ExternalProjectPojo>
              <ExternalProjectPojo>
                <option name="name" value=":App" />
                <option name="path" value="$PROJECT_DIR$/App" />
              </ExternalProjectPojo>
              <ExternalProjectPojo>
                <option name="name" value=":AppComponentTests" />
                <option name="path" value="$PROJECT_DIR$/AppComponentTests" />
              </ExternalProjectPojo>
              <ExternalProjectPojo>
                <option name="name" value=":AppUnitTests" />
                <option name="path" value="$PROJECT_DIR$/AppUnitTests" />
              </ExternalProjectPojo>

I think this is a new value that was added in the update which makes the root folder a project in the build (I don't recall seeing this before). For some reason opening the build.gradle file re-orders this to be the first in that list, but that causes the error. Moving the <ExternalProjectPojo> element with the $PROJECT_DIR$ path to the last one in the list fixed the issue.

Why this is happening I can't say. Is this something the scripts could be updated to do automatically? I guess ultimately it would be good to understand why it causes the problem in the first place.

from android-gradle-template.

nenick avatar nenick commented on July 22, 2024

Thanks for figure it out. I'm faced this issue too.

Yes it should be possible to edit this file automatically like it done for the robolectric support.

I'm thinking about to switch the basic plugin which enable robolectric tests. I got not much feedback from Novoda. And another plugin looks to be on a state where all stuff is supported which i like to have. Except the one thing, that i like to spilt two test kinds (unit tests and integration tests with robolectric).

So the https://github.com/JCAndKSolutions/android-unit-test/ plugin can not have the reported issues because it have all stuff in one module.

Maybe we should report this issue to google. This miss behaviour could occur when you have pur java library modules in your project.

from android-gradle-template.

nenick avatar nenick commented on July 22, 2024

I'm not sure if this the real problem, after restart my Android Studio my Project works fine. In the workspace.xml is still a "wrong" order.

from android-gradle-template.

nenick avatar nenick commented on July 22, 2024

again this error .. i reordered the workspace.xml entries and i still get this message. maybe I did something wrong.

This log line shows the wrong order
Information:Gradle: Executing tasks: [:AppComponentTests:assemble, :AppComponentTests:testClasses, :App:assembleDebug]

It should be like
Information:Gradle: Executing tasks: [:App:assembleDebug, :AppComponentTests:assemble, :AppComponentTests:testClasses]

sometimes it works fine with the workspace.xml order and sometimes this error occur. changing the workspace.xml looks not stable and force project reloads. Maybe this behaviour can reproduced with a simple app which use a pure java module as dependency. Then it should be a general bug at Android Studio and they should fix it ;)

from android-gradle-template.

DylanSale avatar DylanSale commented on July 22, 2024

I believe you are correct that does not work. It was just a coincidence that it started working on our development machines after making that change I think.

I believe it is a bug with Android Studio messing around with the build order like you say.

from android-gradle-template.

nenick avatar nenick commented on July 22, 2024

This behaviour comes only at Android Studio, i never saw it on command line. Looks like the error comes from the make commando. I removed the make commando its not necessary because we recompile tests with a custom gradle command. Its enough and should avoid this issue.

from android-gradle-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.