I need to update cordova-plugin-firebasex to the latest release, I have gone through the plugin installation and configuration steps here https://github.com/dpa99c/cordova-plugin-firebasex#firebase-config-setup.
As of right now i have iOS building correctly and sending analytic data to the firebase console. however android is currently failing when i attempt to build and i am at a loss of what i am missing.
the build errors i am getting are the following:
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
> Task :app:compileDebugJavaWithJavac FAILED
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:860: error: cannot find symbol
handleBooleanTaskOutcome(FirebaseRemoteConfig.getInstance().activate(), callbackContext);
^
symbol: method activate()
location: class FirebaseRemoteConfig
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:872: error: cannot find symbol
handleBooleanTaskOutcome(FirebaseRemoteConfig.getInstance().fetchAndActivate(), callbackContext);
^
symbol: method fetchAndActivate()
location: class FirebaseRemoteConfig
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:884: error: cannot find symbol
handleTaskOutcome(FirebaseRemoteConfig.getInstance().reset(), callbackContext);
^
symbol: method reset()
location: class FirebaseRemoteConfig
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:931: error: cannot find symbol
Map<String, FirebaseRemoteConfigValue> nativeValues = FirebaseRemoteConfig.getInstance().getAll();
^
symbol: method getAll()
location: class FirebaseRemoteConfig
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:954: error: cannot find symbol
settings.setFetchTimeoutInSeconds(args.getLong(0));
^
symbol: method setFetchTimeoutInSeconds(long)
location: variable settings of type Builder
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:958: error: cannot find symbol
settings.setMinimumFetchIntervalInSeconds(args.getLong(1));
^
symbol: method setMinimumFetchIntervalInSeconds(long)
location: variable settings of type Builder
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:961: error: cannot find symbol
handleTaskOutcome(FirebaseRemoteConfig.getInstance().setConfigSettingsAsync(settings.build()), callbackContext);
^
symbol: method setConfigSettingsAsync(FirebaseRemoteConfigSettings)
location: class FirebaseRemoteConfig
/Users/username/src/mobile-ui/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:973: error: cannot find symbol
handleTaskOutcome(FirebaseRemoteConfig.getInstance().setDefaultsAsync(defaultsToMap(defaults)), callbackContext);
^
symbol: method setDefaultsAsync(Map<String,Object>)
location: class FirebaseRemoteConfig
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors```
Related
I have had a promblem.
since I had installed 'react-native-image-picker', App does not executes.
For solving this problem, I had to add to AndroidManifest.xml to permission code.
and npm install jetifier. but everything does not solve this.
OS : windows 10
IDE : webstorm 2020.02
android studio: latest version
Below the code, I have faced error message.
C:\Users\ client>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1236 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
> Task :react-native-image-picker:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
62 actionable tasks: 2 executed, 60 up-to-date
C:\Users\ \node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:34: error: package com.imagepicker.media does not e
xist
import com.imagepicker.media.ImageConfig;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:35: error: package com.imagepicker.permissions does
not exist
import com.imagepicker.permissions.PermissionUtils;
^
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:36: error: package com.imagepicker.permissions does
not exist
import com.imagepicker.permissions.OnImagePickerPermissionsCallback;
^
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:37: error: package com.imagepicker.utils.MediaUtils
does not exist
import com.imagepicker.utils.MediaUtils.ReadExifResult;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:38: error: package com.imagepicker.utils does not e
xist
import com.imagepicker.utils.ReadableMapUtils;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:39: error: package com.imagepicker.utils does not e
xist
import com.imagepicker.utils.RealPathUtil;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:40: error: package com.imagepicker.utils does not e
xist
import com.imagepicker.utils.UI;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:56: error: package com.imagepicker.utils does not e
xist
import static com.imagepicker.utils.MediaUtils.*;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:57: error: package com.imagepicker.utils does not e
xist
import static com.imagepicker.utils.MediaUtils.createNewFile;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:57: error: static import only from classes and inte
rfaces
import static com.imagepicker.utils.MediaUtils.createNewFile;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:58: error: package com.imagepicker.utils does not e
xist
import static com.imagepicker.utils.MediaUtils.getResizedImage;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:58: error: static import only from classes and inte
rfaces
import static com.imagepicker.utils.MediaUtils.getResizedImage;
^
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:86: error: cannot find symbol
private ImageConfig imageConfig = new ImageConfig(null, null, 0, 0, 100, 0, false);
^
symbol: class ImageConfig
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:66: error: cannot find symbol
public static final int DEFAULT_EXPLAINING_PERMISSION_DIALIOG_THEME = R.style.DefaultExplainingPermissionsTheme;
^
symbol: variable DefaultExplainingPermissionsTheme
location: class style
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:86: error: cannot find symbol
private ImageConfig imageConfig = new ImageConfig(null, null, 0, 0, 100, 0, false);
^
symbol: class ImageConfig
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:166: error: cannot find symbol
imageConfig = new ImageConfig(null, null, 0, 0, 100, 0, false);
^
symbol: class ImageConfig
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:168: error: package UI does not exist
final AlertDialog dialog = UI.chooseDialog(this, options, new UI.OnAction()
^
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:168: error: cannot find symbol
final AlertDialog dialog = UI.chooseDialog(this, options, new UI.OnAction()
^
symbol: variable UI
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:274: error: cannot find symbol
final File original = createNewFile(reactContext, this.options, false);
^
symbol: method createNewFile(ReactApplicationContext,ReadableMap,boolean)
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:278: error: cannot find symbol
cameraCaptureURI = RealPathUtil.compatUriFromFile(reactContext, imageConfig.original);
^
symbol: variable RealPathUtil
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:374: error: cannot find symbol
if (ReadableMapUtils.hasAndNotEmptyString(options, "chooseWhichLibraryTitle"))
^
symbol: variable ReadableMapUtils
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:451: error: cannot find symbol
fileScan(reactContext, path);
^
symbol: method fileScan(ReactApplicationContext,String)
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:457: error: cannot find symbol
final ReadExifResult result = readExifInterface(responseHelper, imageConfig);
^
symbol: class ReadExifResult
location: class ImagePickerModule
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:503: error: cannot find symbol
final RolloutPhotoResult rolloutResult = rolloutPhotoFromCamera(imageConfig);
^
symbol: class RolloutPhotoResult
location: class ImagePickerModule
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:597: error: package PermissionUtils does not exist
.explainingDialog(this, options, new PermissionUtils.OnExplainingPermissionCallback()
^
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:596: error: cannot find symbol
final AlertDialog dialog = PermissionUtils
^
symbol: variable PermissionUtils
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:658: error: cannot find symbol
else if (activity instanceof OnImagePickerPermissionsCallback)
^
symbol: class OnImagePickerPermissionsCallback
location: class ImagePickerModule
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:660: error: cannot find symbol
((OnImagePickerPermissionsCallback) activity).setPermissionListener(listener);
^
symbol: class OnImagePickerPermissionsCallback
location: class ImagePickerModule
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:667: error: cannot find symbol
.append(OnImagePickerPermissionsCallback.class.getSimpleName())
^
symbol: class OnImagePickerPermissionsCallback
location: class ImagePickerModule
C:\Users\client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:685: error: cannot find symbol
return RealPathUtil.getRealPathFromURI(reactContext, uri);
^
symbol: variable RealPathUtil
location: class ImagePickerModule
30 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-image-picker: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 25s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\ client\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\ImagePickerModule.java:34: error: package com.imagepicker.media does not exist
so this was building with no problem and then I was having problems with building ios so I removed the android platform and added it again. All the plugins and adding of the platform are being added correctly but when running the command $ ionic cordova build android I get a LOT of errors about not being able to find the symbol.
> Task :app:compileDebugJavaWithJavac FAILED
24 actionable tasks: 5 executed, 19 up-to-date
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic_Notifications.java:35: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
^
symbol: class NotificationManagerCompat
location: package android.support.v4.app
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic.java:57: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic_External_Storage.java:28: error: cannot find symbol
import android.support.v4.os.EnvironmentCompat;
^
symbol: class EnvironmentCompat
location: package android.support.v4.os
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/nl/xservices/plugins/FileProvider.java:4: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
^
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
^
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:121: error: cannot find symbol
#RequiresApi(Build.VERSION_CODES.LOLLIPOP)
^
symbol: class RequiresApi
location: class IonicWebViewEngine.ServerClient
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic_Notifications.java:123: error: cannot find symbol
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(this.cordova.getActivity().getApplicationContext());
^
symbol: class NotificationManagerCompat
location: class Diagnostic_Notifications
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic_Notifications.java:123: error: cannot find symbol
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(this.cordova.getActivity().getApplicationContext());
^
symbol: variable NotificationManagerCompat
location: class Diagnostic_Notifications
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic.java:639: error: cannot find symbol
java.lang.reflect.Method method = ActivityCompat.class.getMethod("shouldShowRequestPermissionRationale", Activity.class, java.lang.String.class);
^
symbol: class ActivityCompat
location: class Diagnostic
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/cordova/plugins/Diagnostic_External_Storage.java:216: error: cannot find symbol
addPath = Environment.MEDIA_MOUNTED.equals(EnvironmentCompat.getStorageState(file));
^
symbol: variable EnvironmentCompat
location: class Diagnostic_External_Storage
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java:169: error: cannot find symbol
fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
^
symbol: method getUriForFile(Context,String,File)
location: class FileProvider
/Users/c.francia/Desktop/application/app/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java:285: error: cannot find symbol
fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
^
symbol: method getUriForFile(Context,String,File)
location: class FileProvider
I have about 25 of those class errors. Never seen this error before and not a java programmer/used the android studio much.
I have found this SO post that looks like it might help? I just don't know how I go about updating the compiler tools through ionic or through the android studio?
I have also updated my SDK tools
Current version: Android Studio 3.5
Build number: AI-191.8026.42.35.5791312
Android SKD Tools: 26.1.1
Android Platform Version: API 29: Android 10.0 (Q) revision 3
$ java --version
$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Try adding the following code in config.xml under android platform
<preference name="ANDROID_SUPPORT_V4_VERSION" default="27.+"/>
<framework src="com.android.support:supportv4:$ANDROID_SUPPORT_V4_VERSION"/>
I'm doing everything exactely as in instruction: https://crosswalk-project.org/documentation/cordova/migrate_an_application.html
After succesfull build of xwalk_core_library and CordovaLib
Im running cordova build android and facing error:
[javac] Compiling 8 source files to D:\myapp\platforms\android\bin\classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] D:\myapp\platforms\android\src\com\in2circle\fellor\CordovaApp.java:33: error: cannot find symbol
[javac] loadUrl(launchUrl);
[javac] ^
[javac] symbol: variable launchUrl
[javac] location: class CordovaApp
[javac] 1 error
Crosswalk v 9.38.208.10.
Crosswalk v 9.38.208.10 plays well with Cordova 3.5.. I have had installed cordova 4..
Updated to Crosswalk v 10.39.235.9 and problem was solved.
So use Crosswalk v 10 for Cordova v 4.
I just download latest facebook SDK from github. I import my facebook SDK into my cordova project, then when I try to build project using cordova build android, I'm always got this error in my terminal. I already done ant clean release, the error still remain. Currently using android sdk 19.
-compile:
[javac] Compiling 94 source files to /Users/MNurdin/Documents/Github/facebook-android-sdk/facebook/bin/classes
[javac] /Users/MNurdin/Documents/Github/facebook-android-sdk/facebook/src/com/facebook/widget/WebDialog.java:349: warning: [deprecation] setSavePassword(boolean) in android.webkit.WebSettings has been deprecated
[javac] webView.getSettings().setSavePassword(false);
[javac] ^
[javac] /Users/MNurdin/Documents/Github/facebook-android-sdk/facebook/src/com/facebook/widget/PickerFragment.java:638: warning: [deprecation] setBackgroundDrawable(android.graphics.drawable.Drawable) in android.view.View has been deprecated
[javac] titleBar.setBackgroundDrawable(titleBarBackground);
[javac] ^
[javac] /Users/MNurdin/Documents/Github/facebook-android-sdk/facebook/src/com/facebook/widget/PickerFragment.java:660: warning: [deprecation] setBackgroundDrawable(android.graphics.drawable.Drawable) in android.view.View has been deprecated
[javac] doneButton.setBackgroundDrawable(doneButtonBackground);
[javac] ^
[javac] 3 warnings
BUILD FAILED
/Applications/android-sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Applications/android-sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
I already search the answers through stackoverflow but still can't get the solution.
I already found the answer. No need to use facebook SDK. I using this one instead facebook SDK from facebook.
https://github.com/phonegap-build/FacebookConnect
I'm trying to run a phonegap application with the PushPlugin installed.
I adde the plugin with this command:
$ phonegap local plugin add https://github.com/phonegap-build/PushPlugin
and it went through ok.
I added the PushNotification.js file to my "www" folder and referenced it in index.html.
Then I added some code to handle notifications in my index.js file.
I tried to run the application:
$ phonegap local run android
and got this:
-compile:
[javac] Compiling 8 source files to /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/bin/classes
[javac] /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/src/com/plugin/gcm/GCMIntentService.java:96: cannot find symbol
[javac] symbol : method getString(java.lang.String)
[javac] location: class com.plugin.gcm.GCMIntentService
[javac] .setTicker(getString("title"))
[javac] ^
[javac] /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/src/com/plugin/gcm/GCMIntentService.java:95: cannot find symbol
[javac] symbol : method getString(java.lang.String)
[javac] location: class com.plugin.gcm.GCMIntentService
[javac] .setContentTitle(getString("title"))
[javac] ^
[javac] 2 errors
BUILD FAILED
/usr/local/Cellar/android-sdk/r22.0.4/tools/ant/build.xml:720: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/r22.0.4/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
What seems to be the problem here?
Thank you.
Found issue, created a PullRequest on project :
https://github.com/phonegap-build/PushPlugin/pull/83/files
You should update the code of line 95 and 96 of android/com/plugin/gcm/GCMIntentService.java
.setContentTitle(extras.getString("title"))
.setTicker(extras.getString("title"))