Github actions add enviroment files to run - linux

I'm trying to create a google-service.json file which is needed for flutter to build when using firebase during a github actions run. I have the base64 encoded content in my secrets and i copy the decoded content to a new file in the android/app directory. However flutter does not seem to find the file even though when i cat i can see the content of the file. What could i be doing wrong
This is how i create the file in the first step
`
- name: Copy google servives
run: echo "${{ secrets.GOOGLE_SERVICE }}" | base64 -d > android/app/google-services.json
then when i run the flutter build command i get this error
Run flutter build apk --release
💪 Building with sound null safety 💪
Running Gradle task 'assembleRelease'...
Note: /opt/hostedtoolcache/flutter/stable-3.3.0-x64/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.7.0/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/home/runner/work/Rentals-Flutter/Rentals-Flutter/android/app/src/release/google-services.json
/home/runner/work/Rentals-Flutter/Rentals-Flutter/android/app/src/google-services.json
/home/runner/work/Rentals-Flutter/Rentals-Flutter/android/app/src/Release/google-services.json
/home/runner/work/Rentals-Flutter/Rentals-Flutter/android/app/google-services.json
* 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 3m 7s
Running Gradle task 'assembleRelease'... 187.8s
Gradle task assembleRelease failed with exit code 1
Error: Process completed with exit code 1.
`

Related

I create new app in flutter with flutter create AppName in vs code terminal it worked but when i try flutter run it shows this error message

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
AAPT: error: failed writing to 'C:\Users\Mii_Ranna\Desktop\vs test\projectname\build\app\intermedias invalid. (13).
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log o
Get more help at https://help.gradle.org
BUILD FAILED in 3m 1s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 190.1s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Je
Building plugin integration_test...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 9.2s
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting ty setting tpath in your project's local properties file at 'C:\src\flutter\packages\integration_test\anhe sdk.dir path in your project's local properties file at 'C:\src\flutter\packages\integrat hion_test\an
droid\local.properties'.
Try: o
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or b
y setting the sdk.dir path in your project's local properties file at 'C:\src\flutter\packag
es\integration_test\android\local.properties'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to ge
t more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 6s
Exception: The plugin integration_test could not be built due to the issue above.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log o
utput. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 6s
Exception: The plugin integration_test could not be built due to the issue above.
Make sure you have Androidx enabled.
android.useAndroidX=true
Make sure the classpath is set properly.
classpath 'com.android.tools.build:gradle:3.5.0'

Gradle task assembleDebug failed in flutter

I encountered this issue trying to run flutter. This happened when I cloned a project from GitHub and then I tried to run its dependency, which didn't run. So what I did was start the project again and typed in the same code base. I saw then this came up:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not download flutter_embedding_debug.jar (io.flutter:flutter_embedding_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408)
> Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/flutter_embedding_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.jar'.
> Could not GET 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/flutter_embedding_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.jar'.
> Connection reset
* 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 16s
Finished with error: Gradle task assembleDebug failed with exit code 1

Gradle Problem When Importing Flutter Project From Git

I imported a Flutter Project from this git repo: https://github.com/gligerglg/geodropin (website: https://itsallwidgets.com/geodropin) by copying the HTTPS, then go to Android Studio -> Check out Project from Version Control -> Git. When I open the project and try to run, this error appear:
* Error running Gradle:
ProcessException: Process "/Users/phuctruong/AndroidStudioProjects/geodropin/android/gradlew" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/phuctruong/AndroidStudioProjects/geodropin/android/app/build.gradle' line: 45
* What went wrong:
A problem occurred evaluating project ':app'.
> For input string: "1.01"
* 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 0s
Command: /Users/phuctruong/AndroidStudioProjects/geodropin/android/gradlew app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
I assume this has something to do with my gradle version and the project's gradle version? I'm a newbie to Flutter so my understanding of gradle is limited. When I check gradle-wrapper.property it said i'm using gradle 4.10.2
Thanks for helping.
Check out the 16th line of app/build.gradle you will see that the number in a string is of float type. VersionCode should always be integer. Check this out https://developer.android.com/studio/publish/versioning
You can remove this error by just changing it to positive integer value like this :
flutterVersionCode = '1'
Now this problem is resolved but however you will get another error related to androidX but thats different question.
Error would be :
BUILD FAILED in 10s
******************************************************************************************* The Gradle failure may have been because of AndroidX incompatibilities
in this Flutter app. See link for more information on
the problem and how to fix it.
******************************************************************************************* Finished with error: Gradle task assembleDebug failed with exit code 1
For this issue you need to migrate the project to androidX,
add it in android/gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
Or if its already there, Check this migration docs for more info.
Or nothing works, you can ask another question.

Flutter Error running Gradle: Exit code 1 (Ubuntu 18.04 LTS)

My error in flutter run
SO: Ubuntu 18.08 LTS
flutter run
Launching lib/main.dart on moto g 6 play in debug mode...
Initializing gradle... 0,7s
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: /home/leonardo/Github/apps-with-flutter/contador_de_pessoas/android/gradlew app:properties:
Starting a Gradle Daemon (subsequent builds will be faster)
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file '/home/leonardo/Github/apps-with-flutter/contador_de_pessoas/android/app/build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
* 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 4s
Please review your Gradle project setup in the android/ folder.
Executing ./android/gradlew return ok!
leonardo#cintra:~/Github/apps-with-flutter/contador_de_pessoas$ ./android/gradlew
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :help
Welcome to Gradle 4.4.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
Please, help me!
Resolved!
I followed the orientation of the #M.Ricciut https://stackoverflow.com/a/52947028/6899896
it worked! But I gave this error (You have not accepted the license agreements of the following SDK components) and solved it
Flutter itself is the issue. For some of the discussion about it: https://github.com/flutter/flutter/pull/23397
In short, following Mahi-K from the above link, you have to edit $flutterRoot/packages/flutter_tools/gradle/flutter.gradle
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
In the gradle wrapper properties gradle/wrapper/gradle-wrapper.properties you may also have to change it to 4.6 or above
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

adding npm module to Tabris results in a failed build with cordova

Being rather new to mobile app development i'm looking at Apache Cordova paired with Tabris.
Tabris requires a particular installation procedure, this creates a ./node_modules sub-folder under the regular ./www folder of a typical cordova project. Build cordova here is not a problem.
After adding 'npm install pouchdb' to ./www/node_modules now the cordova build fails again and again. I don't see what else changed but the addition of pouchdb. Strangely while pouchdb is reported to be just 46KB after installation many more modules were added and it now weighs in at 55MB. I suspect the many extra modules pose an issue.
I suspect i may need to tweak gradle but i'm most clueless where to start.
please advise
--- below the output indicating build failure
.... many lines of output preced
:processDebugManifest
:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-update-manager/build-tools/24.0.2/aapt'' finished with non-zero exit value 1
<<< this is supposedly output from gradle >>>
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 13.708 secs
Error: Error code 1 for command: /usr/sources/mobile/.../platforms/android/gradlew with args: cdvBuildDebug,-b,/usr/sources/mobile/.../platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
... replace path for anonymisation
<<< is my own inserted line >>>
First off: are you using Tabris or Tabris.js? The former is a Java framework and is not compatible with Cordova. The latter is, but if you're trying to use Tabris.js as a slave to Cordova (i.e. using the Cordova build command) that's not going to work. Instead I suggest you convert your project structure Tabris.js's style and then run the build there. If you still encounter errors when after converting your structure and building with Tabris.js, post the full build log in the Tabris.js issue tracker.

Resources