Firebase Realtime database with flutter ERROR - firebase-realtime-database

I have started learning flutter. And was trying to integrate the firebase realtime database into my flutter project. But as soon as I added the dependencies to my build.graddle files of the android part I started to get this error.
Launching lib\main.dart on A37f in debug mode...
* Error running Gradle:
ProcessException: Process "C:\Users\Username
\Desktop\firebase_listview\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Username\Desktop\firebase_listview\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* 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
Command: C:\Users\Username\Desktop\firebase_listview\android\gradlew.bat app:properties
It started when I added
apply plugin: 'com.google.gms.google-services'
to the bottom of the app level build.graddle
And This
classpath 'com.google.gms:google-services:4.3.2'
to my project level gradle file.
I have also added firebase_databasse dependency in the pubspec.yaml file for the flutter under dependencies

Try to change google services classpath
from
classpath com.google.gms:google-services:4.3.2
to
classpath com.google.gms:google-services:4.2.0

Related

Flutter throws an error when running build or run

I keep getting this when I try to run or run a flutter project
/Users/user1/Projects/projectx/ios/Pods/FBSDKCoreKit_Basics/Sources/FBSDK
CoreKit_Basics/FBSDKUserDataStore.m:19:9: fatal error:
'FBSDKUserDataStore.h' file not found
#import "FBSDKUserDataStore.h"
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file
'/Users/user1/Library/Developer/Xcode/DerivedData/Runner-axlixevsrpjdqpcqvk
bkkcevsnce/Build/Products/Debug-iphonesimulator/wakelock/wakelock.framework'
This was caused by an error in one of the dependencies, an update has been released and I was able to run the application.

Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64'

I have created fresh project(Hello World) in KMM followed by their official website. In android it works smooth but when I am trying to run in XCode it's giving errors because of which I am unable to build / run the xcode project. I have attached screenshots and logs for my errors. Somehow xcode scheme is not getting generated in the KMM platform that's what I am guessing.
Can anyone please help me understand what am I missing?
Any help would be appriciated.
Following is my dev env:
Xcode 11.4.1
Android 4.1.2
Kotling Plugin version 1.4.30 (stable)
KMM 0.2.0```
XCode Logs:
> Task :shared:compileKotlinIosX64
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Extracting dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz into /Users/fatin/.konan/dependencies
e: java.lang.RuntimeException: Cannot extract archive with dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz.
> Task :shared:compileKotlinIosX64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:compileKotlinIosX64'.
> Compilation finished with errors
* 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 7s
1 actionable task: 1 executed
Command PhaseScriptExecution failed with a nonzero exit code ```
[![enter image description here][3]][3]
I reached out to community for this and finally found the solution. Here is the link to that issue which I raised and solved this problem.
If anyone else is going through this same issue it mostly cause of corrupted kotlin file.
Also try checking your cmd line tools in XCode as per comments.
Hope this helps someone. Cheers.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

showing gradle error when I run in jenkins

What went wrong:
A problem occurred configuring project ':app'.
You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 23.0.3].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4 mins 22.387 secs
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Archiving artifacts
Finished: FAILURE
I get this error when I build on jenkins on my windows machine. So how could I accept the license and fix the above issue
Have you tried using the new sdkmanager to update your SDK? You just have to run it once on the machine in question to accept the license for a given version.
https://developer.android.com/studio/command-line/sdkmanager.html#usage
You can also use the GUI which comes alongside this tool. See the following question for more information:
https://superuser.com/questions/1161536/android-bat-brings-up-sdk-manager-gui-why-is-sdkmanager-bat-needed

meteor cordova build error for ios platform

I am getting the error below when building meteor with ios platform. A few days ago it all worked fine. OS is Sierra 10.12, meteor 1.4.1.3. When I remove the ios platform it builds fine. Android is not added.
I already tried:
Removed and added ios platform
Removed .meteor/local
Here is the output from the terminal:
Tims-MacBook-Pro:pressIt cmt$ meteor build ../outputPressit --server http://dummy.com
...
=> Errors executing Cordova commands:
While adding plugin https://github.com/meteor/cordova-plugin-meteor-webapp.git#8bf95eed3f313299fc2de33658866278eea2cdc5 to Cordova project:
Cordova error: Failed to fetch plugin https://github.com/meteor/cordova-plugin-meteor-webapp.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: git: Command failed with exit code 128 Error output:
fatal: reference is not a tree: 8bf95eed3f313299fc2de33658866278eea2cdc5
(If the error message contains suggestions for a fix, note that this may not apply to the Meteor integration. You can try running again with the --verbose option to help diagnose the issue.)
I also tried the --verbose option and here is some of the output:
...
%% Copying splash from /Users/cmt/WebstormProjects/pressIt/.meteor/local/cordova-build/resources/iphone6p_landscape.splash.png to /Users/cmt/WebstormProjects/pressIt/.meteor/local/cordova-build/platforms/ios/pressIt/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png
%% updated project successfully
%% Executing "after_plugin_add" hook for all plugins.
Adding plugin https://github.com/meteor/cordova-plugin-meteor weba90-]\m8
-=05643pp.git#8bf95eed3f313299fc2de33658866278eea2cdc5 to Cordova project
%% Executing "before_plugin_add" hook for all plugins.
%% Calling plugman.fetch on plugin "https://github.com/meteor/cordova-plugin-meteor-webapp.git#8bf95eed3f313299fc2de33658866278eea2cdc5"
%% Fetching plugin "https://github.com/meteor/cordova-plugin-meteor-webapp.git" via git clone
%% Running command: git clone https://github.com/meteor/cordova-plugin-meteor-webapp.git /var/folders/p7/s_tltgm15mg63r15wkn1c24c0000gq/T/git/1477224169788
%% Command finished with error code 0: git clone,https://github.com/meteor/cordova-plugin-meteor-webapp.git,/var/folders/p7/s_tltgm15mg63r15wkn1c24c0000gq/T/git/1477224169788
%% Running command: git checkout 8bf95eed3f313299fc2de33658866278eea2cdc5
%% Command finished with error code 128: git checkout,8bf95eed3f313299fc2de33658866278eea2cdc5
=> Errors executing Cordova commands:
While adding plugin https://github.com/meteor/cordova-plugin-meteor-webapp.git#8bf95eed3f313299fc2de33658866278eea2cdc5 to Cordova project:
Cordova error: Failed to fetch plugin https://github.com/meteor/cordova-plugin-meteor-webapp.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: git: Command failed with exit code 128 Error output:
fatal: reference is not a tree: 8bf95eed3f313299fc2de33658866278eea2cdc5
at /Users/cmt/.meteor/packages/meteor-tool/.1.4.1_3.1u5hjow++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/plugman/fetch.js:88:33
at _rejected
This seemed to have been a temporary issue as it got resolved the next day without making related changes.

Jenkins not downloading Android SDK automatically

I'm running Jenkins locally on my mac and I can't seem to get Jenkins to download the Android SDK automatically. I'm not defining a path, and according to the documentation, Jenkins will auto download it. What am I missing here?
"The plugin will automatically download and install the Android SDK, if it's not already installed when a build starts."
Jenkin Log
[Gradle] - Launching build.
[workspace] $ /var/root/.jenkins/jobs/TestingBuild/workspace/gradlew clean
FAILURE: Build failed with an exception.
* Where:
Build file '/private/var/root/.jenkins/jobs/TestingBuild/workspace/app/build.gradle' line: 17
* What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 19.418 secs
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
So two days later... problem solved. I had to place an instance of the android sdk at this location. /Users/Shared/Jenkins/Home/tools/android-sdk. I also set an Environment variable ANDROID_HOME with the same path. Here's a screenshot.

Resources