Problem trying to instantiate Firebase RemoteConfig in Flutter - firebase

When I try to instantiate RemoteConfig, I get this error and the app crashes (not an error, it just closes).
I've read that a workaround would be :
Workaround: go to your pub cache dir, find MethodCallHandler.java and replace this line:
properties.put(
"inDebugMode", firebaseRemoteConfigInfo.getConfigSettings().isDeveloperModeEnabled());
With this:
properties.put("inDebugMode", false);
The problem is that this file does not contain any line as it was described. Any ideas?
Full error:
E/flutter ( 4211): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/flutter ( 4211): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 4211): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/flutter ( 4211): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/flutter ( 4211):
F/flutter ( 4211): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
F/libc ( 4211): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4211 (name_app), pid 4211 (name_app)

The workaround didn't work for me but in my case just changing the platform('com.google.firebase:firebase-bom:26.4.0') to implementation platform('com.google.firebase:firebase-bom') in my android/app/src/main/AndroidManifest.xmlfile fixed the problem.
Cheers

Related

I import a other wordpress file into my wordpress. When i import file its shows:- Fatal error: Uncaught WC_Data_Exception

Fatal error: Uncaught WC_Data_Exception: Invalid billing email address in D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\abstracts\abstract-wc-data.php:810 Stack trace: #0 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\class-wc-customer.php(971): WC_Data->error('customer_invali...', 'Invalid billing...') #1 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\data-stores\class-wc-customer-data-store-session.php(113): WC_Customer->set_billing_email('admin1#localhos...') #2 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\class-wc-data-store.php(159): WC_Customer_Data_Store_Session->read(Object(WC_Customer)) #3 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\class-wc-customer.php(116): WC_Data_Store->read(Object(WC_Customer)) #4 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\class-woocommerce.php(757): WC_Customer->__construct(6, true) #5 D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\wc-core-functions in D:\XAMPP\htdocs\wordpress\wp-content\plugins\woocommerce\includes\abstracts\abstract-wc-data.php on line 810

Next-Auth : defaultCookies is not defined

I'm using next/auth version: 3.27.3
I suddenly got this error while running my app. Anyone encountered this?
error - unhandledRejection: ReferenceError: defaultCookies is not defined
at C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next-auth\dist\server\index.js:102:9
at new Promise (<anonymous>)
at NextAuthHandler (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next-auth\dist\server\index.js:67:10)
at NextAuth (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next-auth\dist\server\index.js:299:10)
at __WEBPACK_DEFAULT_EXPORT__ (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\.next\server\pages\api\auth\[...nextauth].js:188:128)
at Object.apiResolver (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next\dist\server\api-utils.js:101:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async DevServer.handleApiRequest (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next\dist\server\next-server.js:775:9)
at async Object.fn (C:\Users\MAGICSOFT Mike\Desktop\NEW MAGICSOFT\crd-prototype\node_modules\next\dist\server\next-server.js:666:37)
Seems like changing the next-auth version on your package.json file solves this issue.
For my case, changing from version "^3.29.0" to "3.29.3" solved the issue.

Flutter firebase web google sign In error

Error: Unhandled error PlatformException(idpiframe_initialization_failed, Not a valid origin for the client:
http://localhost:62652 has not been registered for client ID
1025728717365-s20p9ubjkfogdb90sc6786iptmgdfhkb.apps.googleusercontent.com.apps.googleusercontent.com. Please go
to https://console.developers.google.com/ and register this origin for your project's client ID.,
https://developers.google.com/identity/sign-in/web/reference#error_codes, null) occurred in Instance of
'SignInFormBloc'.
at Object.throw_ [as throw] (http://localhost:62652/dart_sdk.js:5032:11)
at http://localhost:62652/packages/bloc/src/bloc_observer.dart.lib.js:182:21
at sign_in_form_bloc.SignInFormBloc.new.onError
(http://localhost:62652/packages/bloc/src/bloc_observer.dart.lib.js:183:28)
at _RootZone.runBinaryGuarded (http://localhost:62652/dart_sdk.js:37034:11)
at sendError (http://localhost:62652/dart_sdk.js:30966:26)
at _BroadcastSubscription.new.[_sendError] (http://localhost:62652/dart_sdk.js:30983:11)
at _BroadcastSubscription.new.[_addError] (http://localhost:62652/dart_sdk.js:30909:27)
at http://localhost:62652/dart_sdk.js:31609:34
at _SyncBroadcastStreamController.new.[_forEachListener] (http://localhost:62652/dart_sdk.js:31459:13)
at _SyncBroadcastStreamController.new.[_sendError] (http://localhost:62652/dart_sdk.js:31608:31)
at _SyncBroadcastStreamController.new.[_addError] (http://localhost:62652/dart_sdk.js:31437:25)
at _RootZone.runBinaryGuarded (http://localhost:62652/dart_sdk.js:37034:11)
at sendError (http://localhost:62652/dart_sdk.js:30966:26)
at _ForwardingStreamSubscription.new.[_sendError] (http://localhost:62652/dart_sdk.js:30983:11)
at _ForwardingStreamSubscription.new.[_addError] (http://localhost:62652/dart_sdk.js:30909:27)
at _ForwardingStreamSubscription.new.[_addError] (http://localhost:62652/dart_sdk.js:34968:25)
at _MapStream.new.[_handleError] (http://localhost:62652/dart_sdk.js:34926:24)
at _ForwardingStreamSubscription.new.[_handleError] (http://localhost:62652/dart_sdk.js:34993:38)
at _RootZone.runBinaryGuarded (http://localhost:62652/dart_sdk.js:37034:11)
at sendError (http://localhost:62652/dart_sdk.js:30966:26)
at _ControllerSubscription.new.[_sendError] (http://localhost:62652/dart_sdk.js:30983:11)
at async._DelayedError.new.perform (http://localhost:62652/dart_sdk.js:34251:27)
at _StreamImplEvents.new.handleNext (http://localhost:62652/dart_sdk.js:34328:15)
at async._AsyncCallbackEntry.new.callback (http://localhost:62652/dart_sdk.js:34089:16)
at Object._microtaskLoop (http://localhost:62652/dart_sdk.js:37333:13)
at _startMicrotaskLoop (http://localhost:62652/dart_sdk.js:37339:13)
at http://localhost:62652/dart_sdk.js:33110:9

Sharing file create by an app in MODE_PRIVATE

So I have an app which writes sensor data to a csv file via FileOutputStream in MODE_PRIVATE
FileOutputStream fos = null;
try {
fos = context.openFileOutput(FILE_NAME,Context.MODE_PRIVATE);
for(int i = 0; i< signalList.size(); i++){
Signal s = signalList.get(i);
fos.write(s.toString().getBytes());
}
Log.d("WRITESTATUS","Success");
}
Now I wanted to share this file with other apps (whatsapp,email etc.). To achieve that, I am using the code below to share the intent. I was trying to use MODE_WORLD..something but that didn't work because it was deprecated so I learned through the other stackoverflow questions that we need to use FileProvider to make that happen but that didn't work either.
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("*/*");
File file = getFileStreamPath(FILE_NAME);
Uri uri = FileProvider.getUriForFile(this,"com.example.writefile",file);
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(sharingIntent, "Share SENSOR Data"));
<provider
android:authorities="com.example.writefile"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_path"/>
</provider>
ERROR LOG
2020-06-22 16:27:34.047 6578-6578/? E/ample.writefil: Unknown bits set in runtime_flags: 0x8000
2020-06-22 16:27:34.147 6578-6578/com.example.writefile E/libc: Access denied finding property "vendor.iop.enable_uxe"
2020-06-22 16:27:36.043 6578-6578/com.example.writefile E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.writefile, PID: 6578
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:402)
at android.view.View.performClick(View.java:7158)
at android.view.View.performClickInternal(View.java:7135)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27373)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:235)
at android.app.ActivityThread.main(ActivityThread.java:7441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397)
at android.view.View.performClick(View.java:7158) 
at android.view.View.performClickInternal(View.java:7135) 
at android.view.View.access$3500(View.java:801) 
at android.view.View$PerformClick.run(View.java:27373) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:235) 
at android.app.ActivityThread.main(ActivityThread.java:7441) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) 
Caused by: java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.example.writefile/files/sensor.csv
at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
at com.example.writefile.MainActivity.Clicked(MainActivity.java:266)
at java.lang.reflect.Method.invoke(Native Method) 
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397) 
at android.view.View.performClick(View.java:7158) 
at android.view.View.performClickInternal(View.java:7135) 
at android.view.View.access$3500(View.java:801) 
at android.view.View$PerformClick.run(View.java:27373) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:235) 
at android.app.ActivityThread.main(ActivityThread.java:7441) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) 
Change this and it will work- I have taken hint from here and tried different configuration and this works, I don't know why.
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path
name="sensor"
path="."/>
</paths>

Fatal Exception: java.lang.RuntimeException : unable to start Activity

Hey guys i m new in Android studio help me to out following. i use ActionBarSherlock Library and it hold Reference of current Fragment instance when user pause application.
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maruticourier.android/com.myapplication.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException**
at com.myapplication.fragment.PendingTask.checksyncdata(PendingTask.java:378)
at com.myapplication.fragment.PendingTask.onCreateView(PendingTask.java:182)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:548)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5143)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
you must initialize Activity Object ActionBarSherlock project file

Resources