Making project, I got Project Configuration Exception on console - android-studio

I got this error when I try to building in the console also in the event log I got some error. I don't know why.
Event log:
24/04/2019
13:35 Gradle sync started
13:36 Gradle sync failed: Cause: startup failed:
build file 'C:\Users\PC\Dropbox\Programacion\androidstudio\primera app\build.gradle': 7: unexpected token: ... # line 7, column 9.
...
^
1 error
Consult IDE log for more details (Help | Show Log) (15 s 244 ms)
14:12 Gradle sync started
14:12 Gradle sync failed: Cause: startup failed:
build file 'C:\Users\PC\Dropbox\Programacion\androidstudio\primera app\build.gradle': 7: unexpected token: ... # line 7, column 9.
...
^
1 error
Consult IDE log for more details (Help | Show Log) (672 ms)
14:15 Executing tasks: [assemble]
14:15 Gradle build finished in 329 ms
14:15 Gradle sync started
14:15 Gradle sync failed: Cause: startup failed:
build file 'C:\Users\PC\Dropbox\Programacion\androidstudio\primera app\build.gradle': 7: unexpected token: ... # line 7, column 9.
...
^
1 error
Consult IDE log for more details (Help | Show Log) (669 ms)
14:16 Executing tasks: [assemble]
14:16 Gradle build finished in 174 ms
startup failed:
build file 'C:\Users\PC\Dropbox\Programacion\androidstudio\primera app\build.gradle': 7: unexpected token: ... # line 7, column 9.
...
^
1 error
Open File
I have tried to solve this error but I don't find any fail in the file.
buildscript {
repositories {
// Gradle 4.1 and higher include support for Google's Maven repo using
// the google() method. And you need to include this repo to download
// Android Gradle plugin 3.0.0 or higher.
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
}
}

Related

Gradle task :app:createDebugAndroidTestCoverageReport fails, why?

When I run gradlew createDebugCoverageReport it fails with:
Task :app:connectedDebugAndroidTest
Starting 1 tests on Tablet_Sv2(AVD) - 12
Test results saved as file:/../app/build/outputs/androidTest-results/connected/flavors/app/Tablet_Sv2(AVD)%20-%2012/test-result.pb. Inspect these results in Android Studio by selecting Run > Import Tests From File from the menu bar and importing test-
result.pb.
Task :app:createDebugAndroidTestCoverageReport FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:createDebugAndroidTestCoverageReport'.
A failure occurred while executing com.android.build.gradle.internal.coverage.JacocoReportTask$JacocoReportWorkerAction
Unable to generate Jacoco report
Why?
EDIT:
According to this Answer the app level build.gradle would require
configurations.all{
resolutionStrategy {
eachDependency { details ->
if ('org.jacoco' == details.requested.group) {
details.useVersion "0.8.7"
}
}
}
}

Gradle: Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1

I'm trying to upgrade Gradle version from 4.10.3 to 6.8 for project https://archive.apache.org/dist/groovy/2.5.8/sources/apache-groovy-src-2.5.8.zip
and for that I modified build.gradle this way https://gist.github.com/iva-nova-e-katerina/c2fe31c429d19ecf2e08e53f638de451 , but I have the following error building this project:
└─$ ./gradlew -PskipIndy clean distBin 1 ⨯
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'groovy'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1.
Required by:
project :
> Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1.
> Could not get resource 'https://dl.bintray.com/melix/gradle-javadoc-hotfix-plugin/me/champeau/gradle/gradle-javadoc-hotfix-plugin/0.1/gradle-javadoc-hotfix-plugin-0.1.pom'.
> Could not GET 'https://dl.bintray.com/melix/gradle-javadoc-hotfix-plugin/me/champeau/gradle/gradle-javadoc-hotfix-plugin/0.1/gradle-javadoc-hotfix-plugin-0.1.pom'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Could you tell me how to fix that?
This plugin found in the repository
maven `{ url "https://repo.spring.io/plugins-release" }
look here https://gitee.com/mirrors/spring-social/blob/master/build.gradle`

Running flutter app in vscode and get this error Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

i'm currently facing the problem in running my flutter app in physical device(phone). i'm using android studio 4 and vscode. The error message is below.
Launching lib\main.dart on TECNO B1f in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find target with hash string 'android-29' in: C:\Users\Kitsson\AppData\Local\Android\sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7m 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I would suggest 4 methods to solve this issue , try one after another until it works for you :
Open terminal - run flutter doctor --android-licenses. Just accept all and it should work, if it dosen't then skip to next step.
adding buildToolsVersion in android => app => build.gradle
android { compileSdkVersion 29 buildToolsVersion "29.0.0" ... ... }
This often happens when you have something in your dependency that require internet like firebase. Just turn on your internet or wifi .
If none of them works then turn off developer option and turn it on again by pressing build number 7 times, this will revoke all usb debugging autherisation and ask whether to trust your developing machine , press yes and you will be good to go

Gradle script error

App terminates with below gradle error after two jar files added in lib folder.
Gradle Script Error
:app:packageDebug
Error:duplicate files during packaging of APK C:\Users\Admin\AndroidProjects\ImageUpload\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/LICENSE.txt
Origin 1: C:\Users\Admin\AndroidProjects\ImageUpload\app\libs\httpmime-4.1.jar
Origin 2: C:\Users\Admin\AndroidProjects\ImageUpload\app\libs\httpclient-4.1.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: C:\Users\Admin\AndroidProjects\ImageUpload\app\libs\httpmime-4.1.jar
File 2: C:\Users\Admin\AndroidProjects\ImageUpload\app\libs\httpmime-4.1.jar
Information:BUILD FAILED
Information:Total time: 21.709 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

Gradle - won't allow maxHeapSize to be set?

task test(type: Test, overwrite: true, dependsOn: [setupUser]) {
maxHeapSize "3000m"
allJvmArgs "-Xmx3000m"
}
Error:
* What went wrong:
A problem occurred evaluating root project 'myproject'.
> Could not find method allJvmArgs() for arguments [-Xmx3000m] on root project 'myproject'.
No matter what I try, I get heap issues when I run gradle test. I'm using 1.0-milestone-9
The second line (allJvmArgs "-Xmx3000m") is incorrect syntax which explains why Gradle complains. The first line (maxHeapSize "3000m") is fine and I'd be surprised if it didn't work. "3000m" might be too high a value though and could lead to an error when creating the JVM. In any case, look for the following debug output (-d):
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] creating process builder for Gradle Worker 1
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] in directory /xxx
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] with argument#0 = -Xmx300m
...
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Started Gradle Worker 1.

Resources