Flutter: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin' - firebase

I have been trying to run my Flutter code on IOS device. However I am getting some errors regarding non-modular headers inside Framework module.
Logs:
While building module 'firebase_core' imported from
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_auth-0.20.0+1/ios/Classes/FLTFirebaseAuthPlugin.m:5:
In file included from <module-includes>:1:
In file included from
/Users/admin/Desktop/Ali/GuestInMe/ios/Pods/Target Support
Files/firebase_core/firebase_core-umbrella.h:13:
In file included from
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_core-0.7.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_core-0.7.0/ios/Classes/FLTFirebasePlugin.h:9:9: error:
include of non-modular header inside framework module
'firebase_core.FLTFirebasePlugin':
'/Users/admin/Desktop/Ali/GuestInMe/ios/Pods/Headers/Public/Firebase
Core/FirebaseCore.h'
[-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/admin/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fi
rebase_auth-0.20.0+1/ios/Classes/FLTFirebaseAuthPlugin.m:5:9: fatal
error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>
~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
What I have tried:
I tried to change build settings of Xcode and allow non-modular imports -> flutter clean -> pod install in ios folder -> flutter run
Tried changing the file to public from project, but it already was public.
Reinstall all the pod files.
'firebase_core.FLTFirebasePlugin':

What worked eventually:
Put all the pubspec.yaml dependencies to the latest version.
Delete pubspec.lock, Pods folder in ios and Podfile.lock
Run flutter clean -> flutter pub get -> cd ios -> pod install -> cd .. -> flutter run
And you should be good to go

You can fix it by editing Podfile
post_install do |installer|
installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end
end

Related

Flutter firebase version conflict firebase messaging

I have a firebase flutter app, everything worked, but when I added firebase_messaging: ^5.1.4. The app gives this:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid#[18.0.0], but fire
base-iid version was 19.0.0.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging#18.0.
0
-- Project 'app' depends onto com.google.firebase:firebase-core#17.0.0
-- Project 'app' depends on project 'cloud_functions' which depends onto com.google.firebase:firebase-functions#17.0.0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core#16.0.9
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
These are my other packages
firebase_auth: ^0.11.1+12
firebase_storage: ^3.0.4
cloud_firestore: ^0.12.7+1
cloud_functions: ^0.4.1+1
(they all work)
I have this in my build gradle: classpath 'com.google.gms:google-services:4.2.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
Is there a way of fixing this?
Thank you very much!
I'm currently trying this:
in the app level build.gradle I have this:
apply plugin: 'com.google.gms.google-services'
I'm adding this:
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
(after apply plugin: 'com.google.gms.google-services')
Include Firebase Core dependency in pub spec.yaml and not specifying the versions of firebase dependencies resolve most of the issues.
https://pub.dev/packages/firebase_core
run these two lines
rm Podfile.lock
pod install --repo-update
these will does the job. it took my two days to fix it

Error Running Gradle - gradlew.bat exited abnormally (Error after adding firebase)

I am trying to read the firestore database. I have:
* Registered My app on firebase .
* copied googleservices.json in the app directory.
* copied the dependencies as firebase instructed.
Flutter Doctor
Upgrading Flutter from C:\flutter...
fa174a123..f31fc1bd0 master -> origin/master
* [new branch] revert-34243-flutter_frame_event -> origin/revert-34243-flutter_frame_event
Updating b593f5167..7a4c33425
11 files changed, 488 insertions(+), 83 deletions(-)
Upgrading engine...
Flutter 1.5.4-hotfix.2 • channel stable •
Framework • revision 7a4c33425d (6 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.557], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2019.1)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.35.1)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
Error
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\Users\USER\Desktop\crm\crm\crm\android\gradlew.bat" exited abnormally:
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
*********************************************************
WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX.
See for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.0+4\android\build.gradle' line: 44
* What went wrong:
A problem occurred evaluating project ':firebase_core'.
> ..\..\pubspec.yaml (The system cannot find the file specified)
* 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
BUILD FAILED in 3s
Command: C:\Users\USER\Desktop\crm\crm\crm\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
PUBSPEC.YAML
name: flutter_charts_app
description: A new Flutter application.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
flutter_sparkline: ^0.1.0
flutter_staggered_grid_view: ^0.2.7
flutter_circular_chart: ^0.1.0
font_awesome_flutter: ^8.2.0
cloud_firestore: ^0.12.5
firebase_core: ^0.4.0+4
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page:
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# For details regarding adding assets from package dependencies, see
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
When I review my gradlew.bat file. The "JAVA_HOME goto findJavaFromJavaHome" is underlined in red. But I have both Java and Gradle added to my enviroment variables and path.
#if "%DEBUG%" == "" #echo off
#rem ##########################################################################
#rem
#rem Gradle startup script for Windows
#rem
#rem ##########################################################################
#rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
#rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
#rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
#rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%#eval[2+2]" == "4" goto 4NT_args
:win9xME_args
#rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
#rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
#rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
#rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
#rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
This issue is resolved in the 0.4.0+5 release of firebase_core. Please try updating and let us know if you run into any further issues.
Just upgrade gradle and kotlin version. In my case
ext.kotlin_version: '1.2.71' -> '1.3.50'
It started working fine.
If issue still persist then keep in mind that this issue is specific to android so setup android project in Android Studio. All issue will be shown. Fix them and it will start working.

Vuejs2 firebase with electron error

I have configured electron with vuejs and i would like to add firebae to my project so i have
In my main.js
import * as firebase from 'firebase'
let firebasconfig = {
//config from firebase project
};
Vue.prototype.$firebase = firebase.initializeApp(firebasconfig);
But now am getting an error
Error: Failed to load gRPC binary module because it was not installed
for the current system
Expected directory: electron-v1.8-linux-x64-glibc
Found: [node-v59-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module
I have tried running rebuild but still fails
What elese do i need to do for this to work
I encouter the same issue with
vue-electron 1.0.6
firebase 5.4.2
vuefire 1.4.5
node 6.10.3
The following manipulation has worked for me. I have downgraded :
firebase to 4.6.0
vuefire to 1.4.4
Then ran npm rebuild and yarn and now it works.
I'm not sure all the things I have done are necessary. But for sure it looks like a problem with firebase.

Cannot publish asp.net core/angular project. Can't resolve app.server.module.ngfactory?

Used the VS2017 angular template and created an app. Then tried to publish it. I also upgraded to Angular 5.
Any idea with this error about ngfactory is about ???
ERROR in ./ClientApp/boot.server.ts
Module not found : error : Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfacto
ry' in 'C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\ClientApp' [C:\Users\Matt_Her
b\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.csproj]
# ./ClientApp/boot.server.ts 8:0-94
EXEC : ERROR in error : Please update #angular/cli. Angular 5+ requires at least Angular CLI 1.5
+ [C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.csproj]
at throwNotSupportedError (C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\
packages\compiler-cli\src\ngtools_api.ts:132:9)
at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\Matt_Herb\downloads\ibewsurveyt
emp\ibewsurveytemp\packages\compiler-cli\src\ngtools_api.ts:80:11)
at _donePromise.Promise.resolve.then (C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibew
surveytemp\node_modules\#ngtools\webpack\src\plugin.js:430:58)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:684:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
C:\Users\Matt_Herb\downloads\ibewsurveytemp\ibewsurveytemp\IbewSurveyTemp.csproj(48,5): error MS
B3073: The command "node node_modules/webpack/bin/webpack.js --env.prod" exited with code 2.
ok ... it looks like a problem with your dependencies and so on ..try this:
1 - update your angular cli with : npm install -g #angular/cli
2 - delete your node_modules in your project (maybe with rimraf)
3 - delete your package-lock.json file (if you've one)
4 - try to run in a different folder ng new testProject --skip-install=true (so it generate WITHOUT install packages a new angular project ..)
5 - go in that project and copy the #angular and other dependencies in package.json file and paste in your project .. save the updated package.json
file of your project
6 - run a npm install --f in your project
7 - try to run a ng serve .. and check if the project load
Hope it helps you
Angular 5 needs to use a different compiler plugin to Angular 4,
Try search/replace 'AotPlugin' with 'AngularCompilerPlugin' in webpack.config.js
see: https://www.npmjs.com/package/#ngtools/webpack
The next problem I ran into was that test files fail to compile when publishing,
The 'exclude' properties on webpack rules and on AngularCompilerPlugin constructor do not seem to work, so I've resorted to excluding these in tsconfig.json:
"exclude": [ "bin", "node_modules", "**/*.spec.ts" ],

CordovaError: Platform ios already added

I am running on OS X El Capitan. I am working with VSTS and have the TACO plug installed and also have an ios agent running.
I am following these steps trying to build for IOS.
https://www.visualstudio.com/en-us/docs/build/apps/mobile/cordova-build
I have an agent running in interatice mode:
https://www.visualstudio.com/en-us/docs/build/admin/agents/v2-osx
However, the Cordova build step is failing and I cannot understand why after checking all the steps a few times. See bolded error.
***************************************************************************** Finishing: npm install
****************************************************************************** Starting: Cordova Build ios
============================================================================== Task : Cordova Build Description : Build a hybrid app project
based on the Cordova CLI, Ionic CLI, TACO CLI, or other
Cordova-compliant CLI Version : 1.3.9 Author : Microsoft
Corporation Help : More
Information
============================================================================== DEVELOPER_DIR was undefined DEVELOPER_DIR for build set to
/Applications/Xcode8.0.app/Contents/Developer Input to
determineIdentity:
1 valid identities found
XXX
(YGKU7EWJD4)","keychain":"/Users/jordanmc/Documents/repos/myApp/1/s/_tasktmp.keychain"}
Input to determineProfile:
XXX Got rid of som sensitive info
Module cache at /Users/jordanmc/.taco_home/node_modules cordova
already installed. Adding Xcconfig update hook Module cache at
/Users/jordanmc/.taco_home/node_modules cordova already installed.
Adding support plugin. cp: no such file or directory:
/Users/jordanmc/Documents/repos/myApp/resources/ios/icon/icon-40#3x.png
cp: no such file or directory:
/Users/jordanmc/Documents/repos/myApp/resources/ios/icon/icon-83.5#2x.png
Removing Xcconfig update hook { CordovaError: Platform ios already
added.
at /Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/cordova-lib/src/cordova/platform.js:130:31
at _fulfilled (/Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/q/q.js:749:13)
at /Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/q/q.js:557:44
at flush (/Users/jordanmc/.taco_home/node_modules/cordova/6.4.0/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7) Task failed
> at process._tickCallback (internal/process/next_tick.js:98:9) name: 'CordovaError', message: 'Platform ios already added.',
code: 0, context: undefined }
****************************************************************************** Finishing: Cordova Build ios
****************************************************************************** Starting: Post Job Cleanup
****************************************************************************** Cleaning any cached credential from repository: XXX
****************************************************************************** Finishing: Post Job Cleanup
****************************************************************************** Finishing: Build
I have this configured:
Any help would be great!

Resources