Flutter: installing dependencies on code magic failing - android

I'm trying to create automatic tests for my flutter project and I'm using codemagic for this. https://codemagic.io Anyways, everything works fine on my local machine; however, when I try to run it on codemagic it fails on installing dependencies. Here's part of the output for where it's failing:
FAILURE: Build failed with an exception.
* Where:
Script '/Users/builder/programs/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 200
* What went wrong:
A problem occurred configuring project ':path_provider'.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':path_provider' of type org.gradle.api.Project.
> Could not find method debugProvided() for arguments [file collection] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
I've done some searching related to these errors. I'm seeing a few possible solutions such as upgrading gradle version and make a few adjustments in my files. However, none of the problems pertain to my problem (codemagic) and the solutions generally aren't working. The solutions I was following was they were running on their local machine and they get the error. Mine works locally, but not on the cloud testing environment. Any ideas? (Let me know if there are certain files I should post) Thanks!

Related

Build apk in Travis CI failed for "Instrumentation failed"

Build apk failed in Travis CI. But sometimes it can build successfully, especially in night. I'm not sure it is a network error or other reasons.
SEVERE: APKit-AdkInstrumentor(1): extracting the apk failed rc = 1
Throwable occurred: aC: extracting the apk failed rc = 1
at aG.a(SourceFile:199)
at aG.a(SourceFile:155)
at aG.a(SourceFile:150)
at v.a(SourceFile:142)
at e.f(SourceFile:181)
at e.<init>(SourceFile:88)
at a.<init>(SourceFile:27)
at com.dynatrace.android.instrumentation.AdkInstrumentor.c(SourceFile:337)
at com.dynatrace.android.instrumentation.AdkInstrumentor.main(SourceFile:277)
Instrumentation failed
Task :mobile:autoInstrumentStagUnpinnedRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mobile:autoInstrumentStagUnpinnedRelease'.
Process 'command '/home/travis/build/app-android/mobile/build/tmp/prepareApkit/dynatrace-mobile-agent-android-7.2.4.1262/Android/auto-instrumentor/instrument.sh'' finished with non-zero exit value 5
if you are sure the build is working fine sometimes, I think it may be related to the third party of the application ( I think you want to make sure the Dynatrace Gradle plugin, you should clean and sync your project works successfully then check with Travis-ci configuration)
also, need to check does Travis-ci support this kind of application related to third-party applications
as seen from the link
https://answers.dynatrace.com/questions/213065/auto-instrument-apk-failed.html
You are still using the auto-instrumentor version 7.1.10.2332. If you are using the Dynatrace Gradle plugin, you should clean and sync your project. This behavior should force Android Studio to use the new plugin version.
To troubleshoot your problem we need the full log file. The problem occurs in a 3rd party tool and the root cause is not visible in the stack trace.

compileReleaseJavaWithJavaC failed for react native modules when building a release build

Task :react-native-device-info:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-device-info:compileReleaseJavaWithJavac'.
java.io.FileNotFoundException: /workspace/eos-native/node_modules/react-native-device-info/android/build/intermediates/annotation_processor_list/release/annotationProcessors.json (No such file or directory)
The error makes sense , and the file is not there, but I have no idea why its not there? It is created when I run a debug version of the app and debug versions of my libraries, react-native-device-info, react-orientation-locker etc.. I've cleaned, gradle synched, rebuilt etc. but when trying to assemble or install a release build I get this error within seconds. What is causing the Java
I had the same problem in an android project (without react) when I added a library module.
After searching for a solution for quite some time, I finally deleted the .gradle directory in the project root folder.
This solved the problem for me.
update android gradle plugin to 3.3
update gradle to 4.10.3
fixed the issue for me.

"Could not initialize class" error running lint target from gradle

I'm working on an Android project with two projects inside it. When trying to run a build with gradlew (./gradlew build), I see the following error:
Execution failed for task ':example:lint'.
Could not initialize class
com.android.build.gradle.tasks.Lint$LintGradleIssueRegistry
With stacktrace enabled, this is listed as a java.lang.NoClassDefFoundError.
Oddly, the first time I ran this (which downloaded dependencies), the build failed with a different error:
Execution failed for task ':example:lint'.
lombok/ast/Node
The gradle wrapper that Android SDK created for the project is using Gradle 2.8.
Could this be a configuration issue with the project or my dev machine? I'm trying to avoid using the Android SDK lint tool as this complains about the projects using Gradle (and I hear it may miss some parts of these projects).
Turned out this was a configuration issue in our build.gradle. The following line had been added for testing and never removed:
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
As such, the classes needed for linting were missing.
The following discussion pointed us in the right direction, in case it's useful to anyone else:
https://github.com/evant/gradle-retrolambda/issues/96

Gradle Android task crashing with unclear error

I am trying to run a Gradle Android task generated by libGDX utility (the desktop task runs fine) in IntelliJ IDEA, but I'm only getting this nonspecific error message. What is the issue, or where are the logs, or how to enabled logs?
Information:Gradle: Executing tasks: [:core:assemble, :android:assembleDebug]
Information:24. 10. 2015 16:58 - Compilation completed with 1 error and 0 warnings in 9s 415ms
Error:Gradle: Execution failed for task ':android:proguardDebug'.
> java.io.IOException: Please correct the above warnings first.
PS: Not sure if it is relevant, but I have modified build files and ProGuard file to support Scala as described there.
I did not find a way of getting any useful logs from IntelliJ IDEA. I solved the problem by running Gradle from console.
gradlew assemble --stacktrace --info
Problem was Gradle could not find tools.jar. Adding system environment variable JAVA_HOME pointing to Java SDK directory fixed the issue.

Android Signed APK java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling

I am trying to build a signed APK with Android Studio.
I am getting the following error:
java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
My research leads me to understand that this is caused by one of my dependencies being compiled with an old version of Groovy. My only dependency is the Google Maps API, so that must be it.
(this is a thread that talks some on the issue)
However, I am unable to find a solution to this problem. I have tried several ways of adding the Groovy backports compat 2.3.5:
- adding it to gradle dependencies and syncing the project
- manually adding it to m2
- downloading the jar and adding it as a library
None of these have been successful. It is possible however, that one of these solutions may work, but that I am missing some key piece of information necessary.
If you know what that might be, or if you have another way to solve this, I'd like to hear from you.
Thanks.
[Edit]Here is some additional information
C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid>gradle dependencies --info
Starting Build
Starting file lock listener thread.
Settings evaluated using settings file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\build.gradle'.
Included projects: [root project 'ReuseAndRepairAndroid', project ':app']
Evaluating root project 'ReuseAndRepairAndroid' using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\build.gradle'.
Evaluating project ':app' using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\app\build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not create plugin of type 'AppPlugin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 2.982 secs
[/Edit]

Categories

Resources