Auth0 gradle dependency error - android

I am trying to work with Auth0 in my project and when I try to include it in the build.gradle file I get an error. I've tried adding the following:
compile 'com.auth0.android:auth0:1.10.0'
and
compile 'com.auth0.android:auth0:1.+'
I get the following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
I ran gradlew build --stacktrace and got this:
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:processDebugManifest'.
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Manifest merger failed with multiple errors, see logs
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
14:31:51.285 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
14:31:51.285 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger]
14:31:51.286 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED
14:31:51.286 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger]
14:31:51.286 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 3.378 secs
What am I doing wrong?
Update
Opened AndroidManifest.xml and found this message in the Merged Manifest
Merging Errors: Error: Attribute data#host at AndroidManifest.xml requires a placeholder substitution but no value for <auth0Domain> is provided. app main manifest (this file) Error: Attribute data#scheme at AndroidManifest.xml requires a placeholder substitution but no value for <auth0Scheme> is provided. app main manifest (this file)

Answering my own question here:
The merged manifest had the error
Attribute data#host at AndroidManifest.xml requires a placeholder substitution but no value for <auth0Domain> is provided. app main manifest (this file) Error: Attribute data#scheme at AndroidManifest.xml requires a placeholder substitution but no value for <auth0Scheme> is provided. app main manifest (this file)
Basically saying that auth0Domain and auth0Scheme needed values declared.
I needed to enter the line
manifestPlaceholders = [auth0Domain: "#string/com_auth0_domain", auth0Scheme: "demo"]
in the build.gradle file and then it compile just fine.
Basically follow through instructions before deciding that you're stuck, those instructions were here.

Related

unityLibrary:compileDebugJavaWithJavac

SO WHEN I CLICK BUILD PROJECT IT SAYS ZERO ERRORS BUT I STILL GET THIS
Executing tasks: [clean, :unityLibrary:assembleDebug, :launcher:assembleDebug] in
project C:\Users\mehmo\OneDrive\Documents\Game
> Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used
anymore.
It will be removed in a future version of the Android Gradle plugin, and will no
longer allow you to disable R8.
> Task :clean UP-TO-DATE
> Task :launcher:clean
> Task :launcher:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugJniLibFolders
> Task :launcher:generateDebugBuildConfig
> Task :launcher:generateDebugResValues
> Task :launcher:mergeDebugNativeLibs
> Task :launcher:stripDebugDebugSymbols
> Task :launcher:copyDebugJniLibsProjectAndLocalJars
> Task :launcher:mergeDebugShaders
> Task :launcher:compileDebugShaders
> Task :launcher:generateDebugAssets
> Task :launcher:packageDebugAssets
> Task :launcher:packageDebugRenderscript NO-SOURCE
> Task :launcher:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:processDebugManifest
> Task :launcher:mergeDebugJavaResource
> Task :unityLibrary:clean
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:BuildIl2CppTask
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\armeabi-v7a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_armeabi-v7a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12829 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 12407 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11982 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 11898 milliseconds Generics1.cpp
Time Compile: 11286 milliseconds Generics.cpp
Time Compile: 10922 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 10625 milliseconds mscorlib4.cpp
Time Compile: 9856 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 9713 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 8830 milliseconds Generics10.cpp
Total compilation time: 56052 milliseconds.
Total link time: 2164 milliseconds.
Cleaned up 0 object files.
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\arm64-v8a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_arm64-v8a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12777 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 11706 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11465 milliseconds Generics1.cpp
Time Compile: 11200 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 10710 milliseconds Generics.cpp
Time Compile: 10155 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 9667 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 9315 milliseconds mscorlib4.cpp
Time Compile: 9026 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 8415 milliseconds Generics3.cpp
Total compilation time: 54646 milliseconds.
Total link time: 3373 milliseconds.
Cleaned up 0 object files.
> Task :unityLibrary:mergeDebugJniLibFolders
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:generateDebugBuildConfig
> Task :unityLibrary:generateDebugResValues
> Task :unityLibrary:generateDebugResources
> Task :unityLibrary:packageDebugResources
> Task :unityLibrary:parseDebugLocalResources
> Task :unityLibrary:mergeDebugShaders
> Task :unityLibrary:compileDebugShaders
> Task :unityLibrary:generateDebugAssets
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:generateDebugResources
> Task :unityLibrary:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:javaPreCompileDebug
> Task :launcher:packageDebugResources
> Task :launcher:parseDebugLocalResources
> Task :unityLibrary:mergeDebugNativeLibs
> Task :unityLibrary:stripDebugDebugSymbols
> Task :unityLibrary:copyDebugJniLibsProjectAndLocalJars
> Task :unityLibrary:mergeDebugJavaResource
> Task :unityLibrary:generateDebugRFile
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#35383760) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 59s
34 actionable tasks: 31 executed, 3 up-to-date
IN DEBUG I GET THIS:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#4ece53fe) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2021-05-19T16:15:40.481+0100 [WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler]
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2m 1s
I encountered this issue as well and decided to scrap my entire project and do a clean setup. Turns out that Gradle 7.x is incompatible with Android development. If you downgrade your Gradle to 6.9 everything works as expected.
This would explain also why "Build Project" works, but through Gradle it doesn't, it's a different wrapper instance.
Changing the Gradle version of distributionUrl in gradle-wrapper.properties file works for me.
I'm now using Unity 2021.3.5f1 version. From here (https://docs.unity3d.com/Manual/android-gradle-overview.html), I know that I should use Gradle version 6.1.1.
To change the Gradle version, open gradle-wrapper.properties file, update distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip with the Gradle version found above. Then, sync and rebuild the project. Build success!
Hope it would help you!

Build get failed while migrating android project to AndroidX

My project is using lombok library. I am trying to migrate my project to AndroidX. But its build failed with below exception.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Failed to transform file 'lombok-1.18.4.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
Failed to transform '/Users/xxx/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.4/7103ab519b1cdbb0642ad4eaf1db209d905d0f96/lombok-1.18.4.jar' using Jetifier. Reason: The type does not support '.' as package separator!. (Run with --stacktrace for more details.) To disable Jetifier, set android.enableJetifier=false in your gradle.properties file.
* Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1013)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:123)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:987)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:76)
Caused by: org.gradle.api.artifacts.transform.ArtifactTransformException: Failed to transform file 'lombok-1.18.4.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
at org.gradle.api.internal.artifacts.transform.UserCodeBackedTransformer.transform(UserCodeBackedTransformer.java:89)
at org.gradle.api.internal.artifacts.transform.ChainedTransformer.transform(ChainedTransformer.java:36)
at org.gradle.api.internal.artifacts.transform.TransformArtifactOperation.run(TransformArtifactOperation.java:41)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.api.internal.artifacts.transform.UserCodeBackedTransformer.transform(UserCodeBackedTransformer.java:87)
... 17 more
Caused by: java.lang.IllegalArgumentException: The type does not support '.' as package separator!
at com.android.tools.build.jetifier.core.type.JavaType.<init>(JavaType.kt:28)
at com.android.tools.build.jetifier.processor.transform.bytecode.asm.CustomRemapper.map(CustomRemapper.kt:29)
at org.objectweb.asm.commons.Remapper.mapPackageName(Remapper.java:235)
at org.objectweb.asm.commons.ModuleRemapper.visitExport(ModuleRemapper.java:78)
at org.objectweb.asm.ClassReader.readModule(ClassReader.java:774)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:632)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer.runTransform(ByteCodeTransformer.kt:39)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:328)
at com.android.tools.build.jetifier.processor.archive.ArchiveFile.accept(ArchiveFile.kt:41)
at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:316)
at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:66)
at com.android.tools.build.jetifier.processor.Processor.transformLibrary(Processor.kt:312)
at com.android.tools.build.jetifier.processor.Processor.transform(Processor.kt:175)
at com.android.build.gradle.internal.dependency.JetifyTransform.transform(JetifyTransform.kt:199)
... 39 more
Here is my gradle.properties file
org.gradle.jvmargs=-Xmx2560M
pgiMixpanelToken="null"
pgiProdApiKey="null"
android.databinding.enableV2=true
android.useAndroidX=true
android.enableJetifier=true
Please help me to resolve this.

Build Failing with Program type already present: android.net.http.SslCertificate

My build is failing with the following stack trace. I have been searching for this for over two hours but to no avail. Can anyone suggest what this error is or why it's happening?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
...
Caused by: com.android.build.api.transform.TransformException: Error while generating the main dex list.
at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:127)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 41 more
Caused by: com.android.builder.multidex.D8MainDexList$MainDexListException: com.android.tools.r8.errors.CompilationError: Program type already present: android.net.http.SslCertificate
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:87)
at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:114)
... 44 more
Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: android.net.http.SslCertificate
at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:64)
at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:25)
at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:24)
at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:121)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:122)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:36)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:95)
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:83)
... 45 more

Jenkins gradle sonarQube Android

I have to setup a job on Jenkins to build an Android Application. I have also a SonarQube server which is accessible at http://x.x.x.198/sonar.
I added a shell script that will be called to launch sonarqube analysis on the project.
SonarQube server and Jenkins run on different server, and I can access to the SonarQube host from Jenkins machine.
The build failed and here is the console output:
./gradlew sonarqube --stacktrace -Dsonar.url.host=http://x.x.x.198/sonar
Parallel execution with configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:sonarqubeSonarQube server [http://x.x.x.198/sonar] can not be reached
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:sonarqube'.
> Unable to execute SonarQube
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:sonarqube'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:83)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 14 more
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)
at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
... 28 more
Caused by: java.lang.IllegalStateException: Status returned by url [http://10.133.64.198/sonar/batch_bootstrap/index] is not valid: [403]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:116)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:78)
... 31 more
BUILD FAILED
Total time: 1.632 secs
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Has anyone already faced this problem? Need help :|
Thanks in advance.
Finaly found why it doesn't work. In my gradle.properties, i had specified some proxy properties. I have removed these entries (host, port, login, password, ...) so when sonarqube task is called, gradle does not use any proxy to access the SonarQube server. The task finished successfully on Jenkins and analysis reports uploaded to sonarqube server :).
This post helped me Sonarqube grade build failed with "SonarQube server [http://x.12.11.18:9000] can not be reached"
Hope this will help others.
2.7.1 is not back-compatible. Lock your plugin version to 2.6 in your pom.xml or upgrade your SonarQube
Workaround: Adding -Dsonar.host.url=http://my.server:9000 to mvn command works for me
Better than disabling the plugin, you may fix the plugin version to
2.6, which works fine, taking into account sonar.host.url.
For instance, with Maven in my case:
<pluginManagement>
</plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.6</version>
<!-- sonar.host.url not working with version 2.7 -->
</plugin>
</plugins>
</pluginManagement>

Error Gradle when generate apk in Android Studio: Exception parsing classes

I have a problem when I generate signed Apk file in Android studio. I get a messages below:
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
:app:transformClassesWithDexForRelease FAILED
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 1
I use proguard in build gradle:
classpath 'com.android.tools.build:gradle:2.1.0'
I was searching through many existing answers, but it's not worked.
I refer this topic, but i can not find anything like this.
When try to use gradlew assembleRelease, I find the message:
Cause: java.lang.RuntimeException: Exception parsing classes
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:761)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:727)
at com.android.dx.command.dexer.Main.access$1200(Main.java:87)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1655)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:681)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:578)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.run(Main.java:286)
at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:52)
at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1511)
at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1507)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.dx.cf.iface.ParseException: name already added: string{"a"}
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:156)
at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96)
at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213)
at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
at com.android.dx.cf.direct.FieldListParser.getList(FieldListParser.java:54)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:536)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:773)
at com.android.dx.command.dexer.Main.access$1600(Main.java:87)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1694)
at com.android.dx.command.dexer.Main.processClass(Main.java:758)
... 17 more
Caused by: java.lang.IllegalArgumentException: name already added: string{"a"}
at com.android.dx.rop.annotation.Annotation.add(Annotation.java:208)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotation(AnnotationParser.java:264)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationParser.java:223)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(AnnotationParser.java:152)
at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(StdAttributeFactory.java:632)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationPa
at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(Anno
at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(
at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory
at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:9
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.
... 30 more
1 error; aborting
:app:transformClassesWithDexForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.proce
s.ProcessException: Return code 1 for dex process
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug op
BUILD FAILED
I tried create new project and copy all gradle, proguard-pro and it build ok.
I don't know why?
What can be other possible solution please ?

Categories

Resources