The two snippets that you show are identical, and both of them miss a ‘path:’ right before the project path. Anyway, unless project A does something special, the simpler declaration ‘compile project(":A")’ should suffice. This implicitly refers to the ‘default’ configuration of A, which, unlike the ‘compile’ configuration, contains not only the compile dependencies of A but also its artifact. (Actually also the runtime dependencies, but this shouldn’t hurt.)
PS: Please use HTML code tags to make code snippets and Gradle output more readable.