Gradle Build Fails with 2 errors #2

Open
opened 2016-02-02 01:07:17 +00:00 by SuperiorNyx · 6 comments
SuperiorNyx commented 2016-02-02 01:07:17 +00:00 (Migrated from github.com)

Followed instructions for how to fix some build problems ("No resource found that matches the given name") by installing the newest preview version of Android Studio. Fixed problems with building blue-alliance-api by directly pulling it and then manually moving it to the ScoutingApp folder.

We expected that the build errors would be resolved, allowing the project to be built, and letting us continue with the app development.

However, the same build errors from before occurred and the Gradle build failed again. The problem is with the AndroidManifest.xml file in blue-alliance-api, but any attempts to fix it haven't worked. Currently, the laptop that these errors are occurring with is the only laptop we have available to develop the app, so we would like it to work as soon as possible.

Followed instructions for how to fix some build problems ("No resource found that matches the given name") by installing the newest preview version of Android Studio. Fixed problems with building blue-alliance-api by directly pulling it and then manually moving it to the ScoutingApp folder. We expected that the build errors would be resolved, allowing the project to be built, and letting us continue with the app development. However, the same build errors from before occurred and the Gradle build failed again. The problem is with the AndroidManifest.xml file in blue-alliance-api, but any attempts to fix it haven't worked. Currently, the laptop that these errors are occurring with is the only laptop we have available to develop the app, so we would like it to work as soon as possible.
afitz0 commented 2016-02-02 01:46:43 +00:00 (Migrated from github.com)

Two-ish questions:

  1. Can you copy-paste the full error here?
  2. What attempts to fix have you tried so far?

Also, make sure that the AndroidManifest.xml you're editing is not one of the manifests in a build directory; editing one of these files will not have any effect. You can tell these apart a couple of ways:

  • The file's tab background is a different color (yellow/green-ish)
  • If you hover over the tab, it'll give you the full path. You want to look for things like "build" or "intermediates"
  • Android Studio 2.0-preview should warn you with a banner at the top of the file that "files under the build directory should not be edited"
Two-ish questions: 1. Can you copy-paste the full error here? 2. What attempts to fix have you tried so far? Also, make sure that the `AndroidManifest.xml` you're editing is **not** one of the manifests in a build directory; editing one of these files will **_not_** have any effect. You can tell these apart a couple of ways: - The file's tab background is a different color (yellow/green-ish) - If you hover over the tab, it'll give you the full path. You want to look for things like "build" or "intermediates" - Android Studio 2.0-preview should warn you with a banner at the top of the file that "files under the build directory should not be edited"
SuperiorNyx commented 2016-02-02 02:27:46 +00:00 (Migrated from github.com)

The first error that comes up says "No resource found that matches the given name (at 'label' with value '@string/module_name')." I remember the error verbatim, but as far as I could find within any area of the project, 'module_name' only appears in the AndroidManifest.xml file for blue-alliance-api. It is surrounded by other unresolved errors that do not appear in the console, but that say "Attribute not allowed here" when hovered over. As far as I found through research, thsee errors are caused by the "No resource found..." error.

I've tried editing every .xml file that has '@string/app_name' to include a statement that has 'module_name' and I've tried to switch 'module_name' so that it matches somewhere else, but none of these worked. From what other users have said, the error might have something to do with the libraries/file path, and some people have resolved it by "cleaning and rebuilding" the project, but I couldn't find any resource that says how to do that in this version (or the version I was using before) of Android Studio. I only updated AS this afternoon, and I undid any changes I made around 'module_name'.

The first error that comes up says "No resource found that matches the given name (at 'label' with value '@string/module_name')." I remember the error verbatim, but as far as I could find within any area of the project, 'module_name' only appears in the AndroidManifest.xml file for blue-alliance-api. It is surrounded by other unresolved errors that do not appear in the console, but that say "Attribute not allowed here" when hovered over. As far as I found through research, thsee errors are caused by the "No resource found..." error. I've tried editing every .xml file that has '@string/app_name' to include a statement that has 'module_name' and I've tried to switch 'module_name' so that it matches somewhere else, but none of these worked. From what other users have said, the error might have something to do with the libraries/file path, and some people have resolved it by "cleaning and rebuilding" the project, but I couldn't find any resource that says how to do that in this version (or the version I was using before) of Android Studio. I only updated AS this afternoon, and I undid any changes I made around 'module_name'.
SuperiorNyx commented 2016-02-02 02:37:32 +00:00 (Migrated from github.com)

The second error that comes up when the Gradle build fails is a longer one that I can remember the full content of, but that is still visible when looking at the build failed terminal in Android Studio. It is something about the libraries and the URI used to access them (schemas.android...). When hovering over the URI at the top of the Manifest, it simply says "URI is not registered." From what I found again, this has to do with the directories and file paths, but trying to move or change the directories only resulted in other errors. Once again, others found success in modifying the directories or cleaning and rebuilding the project, as well as checking for typos in the file names (which I couldn't find, but I might have missed something).

The second error that comes up when the Gradle build fails is a longer one that I can remember the full content of, but that is still visible when looking at the build failed terminal in Android Studio. It is something about the libraries and the URI used to access them (schemas.android...). When hovering over the URI at the top of the Manifest, it simply says "URI is not registered." From what I found again, this has to do with the directories and file paths, but trying to move or change the directories only resulted in other errors. Once again, others found success in modifying the directories or cleaning and rebuilding the project, as well as checking for typos in the file names (which I couldn't find, but I might have missed something).
afitz0 commented 2016-02-02 02:42:46 +00:00 (Migrated from github.com)

Cleaning and rebuilding can be found from the Build menu:

screen shot 2016-02-01 at 6 28 15 pm

You can also manually clean by deleting all folders named "build". You can either find these by looking through Windows explorer, or by switching Android Studio to the "Project" view and deleting those files from there:

screen shot 2016-02-01 at 6 32 24 pm

If you're seeing "Attribute not allowed here" errors, then you're probably editing a file within a build folder. You also shouldn't need to add "module_name" anywhere; this is something that Android Studio itself is supposed to handle.

It's more likely related to the aforementioned libraries/file paths. A couple of things you could try or check:

  1. Cleaning and rebuilding as mentioned.
  2. Look at the "scouting-app" module's dependencies, and ensuring that "blue-alliance-api" is listed:
    • screen shot 2016-02-01 at 6 38 58 pm
    • You get to this window via File -> Project Structure, then selecting "scouting-app" and then the "Dependencies" tab.
  3. In that same window, ensure that "blue-alliance-api" is actually listed in the left-hand pane. If not, you'll need to re-add it. (This is unlikely to be the case.)
  4. Completely deleting this project then re-cloning and re-importing.

I can also take a look at it the next time I'm in front of that laptop (or the next time it appears in front of me).

Cleaning and rebuilding can be found from the Build menu: <img width="593" alt="screen shot 2016-02-01 at 6 28 15 pm" src="https://cloud.githubusercontent.com/assets/400613/12737993/d91232ca-c911-11e5-9d45-ff25b6e20b30.png"> You can also manually clean by deleting all folders named "build". You can either find these by looking through Windows explorer, or by switching Android Studio to the "Project" view and deleting those files from there: <img width="266" alt="screen shot 2016-02-01 at 6 32 24 pm" src="https://cloud.githubusercontent.com/assets/400613/12738033/308e2a36-c912-11e5-9767-da0a8a07b736.png"> If you're seeing "Attribute not allowed here" errors, then you're probably editing a file within a build folder. You also shouldn't need to add "module_name" anywhere; this is something that Android Studio itself is supposed to handle. It's more likely related to the aforementioned libraries/file paths. A couple of things you could try or check: 1. Cleaning and rebuilding as mentioned. 2. Look at the "scouting-app" module's dependencies, and ensuring that "blue-alliance-api" is listed: - <img width="838" alt="screen shot 2016-02-01 at 6 38 58 pm" src="https://cloud.githubusercontent.com/assets/400613/12738148/1ddc78f6-c913-11e5-8a26-b66b358fd47e.png"> - You get to this window via File -> Project Structure, then selecting "scouting-app" and then the "Dependencies" tab. 3. In that same window, ensure that "blue-alliance-api" is actually listed in the left-hand pane. If not, you'll need to re-add it. (This is unlikely to be the case.) 4. Completely deleting this project then re-cloning and re-importing. I can also take a look at it the next time I'm in front of that laptop (or the next time it appears in front of me).
SuperiorNyx commented 2016-02-02 21:31:45 +00:00 (Migrated from github.com)

Thank you for your help! Ms. Myers told me you worked on this last night, so thank you for your time as well.
I was wondering if you could summarize what you found out last night (just so I could understand a little better)? She told me that the project just needed to be built, are there any other steps that still need to be taken?

Also, just in case you didn't know, when I try to build right now another error comes up that says:
"Thank you for your help! Ms. Myers told me you worked on this last night, so thank you for your time as well.
I was wondering if you could summarize what you found out last night (just so I could understand a little better)? She told me that the project just needed to be built, are there any other steps that still need to be taken?

Also, just in case you didn't know, when I try to build right now another error comes up that says:
"Error:Failed to complete Gradle execution.
Cause:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.10/userguide/gradle_daemon.html

Please read the following process output to find out more:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.""

Thank you for your help! Ms. Myers told me you worked on this last night, so thank you for your time as well. I was wondering if you could summarize what you found out last night (just so I could understand a little better)? She told me that the project just needed to be built, are there any other steps that still need to be taken? Also, just in case you didn't know, when I try to build right now another error comes up that says: "Thank you for your help! Ms. Myers told me you worked on this last night, so thank you for your time as well. I was wondering if you could summarize what you found out last night (just so I could understand a little better)? She told me that the project just needed to be built, are there any other steps that still need to be taken? Also, just in case you didn't know, when I try to build right now another error comes up that says: "Error:Failed to complete Gradle execution. Cause: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.10/userguide/gradle_daemon.html Please read the following process output to find out more: Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.""
afitz0 commented 2016-02-02 23:05:50 +00:00 (Migrated from github.com)

That error means that gradle was trying to reserve more memory (RAM) than
the laptop would allow. There should be a file called something like
"build.properties" where you can reduce how much memory it's trying to use.

It'll have a line that has things like "-Xms512m". Given how little memory
that laptop seems to be able to use, try lowering that number to around 256.

On Tue, Feb 2, 2016, 1:31 PM Rebecca Nicacio notifications@github.com
wrote:

Thank you for your help! Ms. Myers told me you worked on this last night,
so thank you for your time as well.
I was wondering if you could summarize what you found out last night (just
so I could understand a little better)? She told me that the project just
needed to be built, are there any other steps that still need to be taken?

Also, just in case you didn't know, when I try to build right now another
error comes up that says:
"Thank you for your help! Ms. Myers told me you worked on this last night,
so thank you for your time as well.
I was wondering if you could summarize what you found out last night (just
so I could understand a little better)? She told me that the project just
needed to be built, are there any other steps that still need to be taken?

Also, just in case you didn't know, when I try to build right now another
error comes up that says:
"Error:Failed to complete Gradle execution.
Cause:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at
https://docs.gradle.org/2.10/userguide/gradle_daemon.html

Please read the following process output to find out more:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.""

Reply to this email directly or view it on GitHub
https://github.com/IronRiders/ScoutingApp/issues/2#issuecomment-178832773
.

That error means that gradle was trying to reserve more memory (RAM) than the laptop would allow. There should be a file called something like "build.properties" where you can reduce how much memory it's trying to use. It'll have a line that has things like "-Xms512m". Given how little memory that laptop seems to be able to use, try lowering that number to around 256. On Tue, Feb 2, 2016, 1:31 PM Rebecca Nicacio notifications@github.com wrote: > Thank you for your help! Ms. Myers told me you worked on this last night, > so thank you for your time as well. > I was wondering if you could summarize what you found out last night (just > so I could understand a little better)? She told me that the project just > needed to be built, are there any other steps that still need to be taken? > > Also, just in case you didn't know, when I try to build right now another > error comes up that says: > "Thank you for your help! Ms. Myers told me you worked on this last night, > so thank you for your time as well. > I was wondering if you could summarize what you found out last night (just > so I could understand a little better)? She told me that the project just > needed to be built, are there any other steps that still need to be taken? > > Also, just in case you didn't know, when I try to build right now another > error comes up that says: > "Error:Failed to complete Gradle execution. > Cause: > Unable to start the daemon process. > This problem might be caused by incorrect configuration of the daemon. > For example, an unrecognized jvm option is used. > Please refer to the user guide chapter on the daemon at > https://docs.gradle.org/2.10/userguide/gradle_daemon.html > > Please read the following process output to find out more: > Error occurred during initialization of VM > Could not reserve enough space for object heap > Error: Could not create the Java Virtual Machine. > Error: A fatal exception has occurred. Program will exit."" > > — > > Reply to this email directly or view it on GitHub > https://github.com/IronRiders/ScoutingApp/issues/2#issuecomment-178832773 > .
Commenting is not possible because the repository is archived.
No description provided.