error compiling my ionic app using ionic package - ionic-framework

I am trying to build a release version of my Ionic app for android, using $ ionic package build android --release --profile profile_production, but I get the following error. Can you help please ?
Nota: ionic build android leads to no error.
:compileReleaseJavaWithJavac/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:11: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:12: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthUtil;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:13: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.UserRecoverableAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:193: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:202: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:205: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:210: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:213: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:217: error: cannot find symbol
catch (UserRecoverableAuthException userAuthEx) {
^
symbol: class UserRecoverableAuthException
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:227: error: cannot find symbol
} catch (GoogleAuthException e) {
^
symbol: class GoogleAuthException
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
10 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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: 8.201 secs
Error: Error code 1 for command: /home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/gradlew with args: cdvBuildRelease,-b,/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

First time answering here, but this post worked for me, so I think I got to paste it here.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
What i did change was the plugin installed, instead of the cordova normal plugin, i added the git one, like this code:
cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid

Related

Flutter problem: Error when building for Web

Fairly new to Flutter, decided to build for Web and got these following errors:
Launching lib\main.dart on Edge in debug mode...
lib\main.dart:1
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:1
export 'package:firebase_core/src/internals.dart' hide guard;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:5
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:2
export 'package:firebase_core/src/internals.dart' hide guardWebExceptions;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:6
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Method not found: 'guard'.
../…/src/internals.dart:10
return internals.guard(
^^^^^
: Error: Method not found: 'guardWebExceptions'.
../…/src/internals.dart:11
return internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
Failed to compile application.
Exited (sigterm)
I tried upgrading packages, but no luck. Any idea what might be causing this issue?

How to receive notification with one signal when app is in background or closed

I can only receive push notif when app is in foreground, followed instructions here and created a .java file in com.package.name now I have 2 files there MainActivity.java And NotificationServiceExtension.java
One signal version 3.4.2.
Also posted this on github
Added this on my manifest
<meta-data android:name="com.onesignal.NotificationServiceExtension"
android:value="com.bonfire.cdis.NotificationServiceExtension" />
Here is the error
Launching lib\main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:24: error: cannot find symbol
builder.setColor(new BigInteger("FF00FF00", 16).intValue());
^
symbol: class BigInteger
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
9 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Exception: Gradle task assembleDebug failed with exit code 1

flutter permission_handler Build fail

I am trying to add the package permission_handler to my flutter project but I cannot run the app. I get a build error. This is the error I get
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:321: error: cannot find symbol
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
^
symbol: variable S
location: class VERSION_CODES
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:72: error: cannot find symbol
case Manifest.permission.BLUETOOTH_SCAN:
^
symbol: variable BLUETOOTH_SCAN
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:74: error: cannot find symbol
case Manifest.permission.BLUETOOTH_ADVERTISE:
^
symbol: variable BLUETOOTH_ADVERTISE
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:76: error: cannot find symbol
case Manifest.permission.BLUETOOTH_CONNECT:
^
symbol: variable BLUETOOTH_CONNECT
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:259: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_SCAN);
^
symbol: variable BLUETOOTH_SCAN
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:270: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_ADVERTISE);
^
symbol: variable BLUETOOTH_ADVERTISE
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:281: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_CONNECT);
^
symbol: variable BLUETOOTH_CONNECT
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:370: error: cannot
find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, null, permission )) {
^
symbol: variable S
location: class VERSION_CODES
8 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 2m 48s
I have reverted to an earlier version but I would like to know what is the cause of this error. My compile version is 30
as said in plugin github repository
These new permissions are supported on Android 12, to resolve this problem make sure to set the compileSdkVersion in your app/build.gradle file to 31.
for more information have a look at here

I want to solve the failure of build in Flutter App

while taking build some 3rd party packages like flutter_form_builder,flutter_chips_inputalso flutter services packages throws error,that leads to build failure ,I think that is package version crash problem.... but, i can't solve this problem....
How can i solve it?
below is error code.
thank you.
ERROR CODE
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: Type 'RangeSemanticFormatterCallback' not found.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chips_input-1.6.1/lib/src/chips_input.dart:62:7: Error: The non-abstract class 'ChipsInputState' is missing implementations for these members:
- TextInputClient.currentAutofillScope
- TextInputClient.currentTextEditingValue
- TextInputClient.performPrivateCommand
- TextInputClient.showAutocorrectionPromptRect
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChipsInputState<T> extends State<ChipsInput<T>>
^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:805:22: Context: 'TextInputClient.currentAutofillScope' is defined here.
AutofillScope? get currentAutofillScope;
^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:793:25: Context: 'TextInputClient.currentTextEditingValue' is defined here.
TextEditingValue? get currentTextEditingValue;
^^^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:814:8: Context: 'TextInputClient.performPrivateCommand' is defined here.
void performPrivateCommand(String action, Map<String, dynamic> data);
^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:823:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
void showAutocorrectionPromptRect(int start, int end);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
void install(OverlayEntry insertionPoint) {
^
../flutter/packages/flutter/lib/src/widgets/routes.dart:46:8: Context: This is the overridden method ('install').
void install() {
^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: 'RangeSemanticFormatterCallback' isn't a type.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
super.install(insertionPoint);
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/gabriel/Git/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/gabriel/Git/flutter/bin/flutter'' finished with non-zero exit value 1
* 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 32s
############## Solution Things ###############
That situation is caused by selecting wrong package version....
so, i try to change version of "flutter_form_builder"!
and i solved this problem!
This is due to incompatibilty of flutter_form_builder with your version of flutter. As advised on the github page of flutter_form_builder, you need to choose the plugin according to your version of flutter.
From the github page:
For Flutter 1.17.x, use version 3.12.x
For Flutter 1.20.x, use version 3.13.x
For Flutter 1.22.X, use version 3.14.x
You have to type the correct version number in pubspec.yaml
Remove pubspec.lock, remove podfile.lock, and run
cd ios && pod repo update && cd .. && flutter clean && flutter pub get

i update my flutter version Error in ruining flutter app

i update my flutter version to last update and i have error when in running my app
error:
Launching lib\main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(properties);
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
ifPresent: _completer?.toStringShort(),
^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(description);
^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\lenovo\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\lenovo\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 52s
Exception: Gradle task assembleDebug failed with exit code 1
-- Run pub upgrade in the pubspec.yaml
-- Run pub get in the pubspec.yaml
-- Then run Flutter Clean
-- Restart your IDE
I faced similar error and that worked for me