Posts

Showing posts from April, 2024

Error : One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

To fix the error: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts As discussed at Google I/O 2023, registering receivers with intention using the RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED flag was introduced as: Solution Outline: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { registerReceiver (broadcastReceiver, intentFilter, RECEIVER_EXPORTED) }else { registerReceiver (broadcastReceiver, intentFilter) } Exact Code: if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . TIRAMISU ) { registerReceiver( onDownloadComplete , new IntentFilter( DownloadManager . ACTION_DOWNLOAD_COMPLETE ), RECEIVER_EXPORTED ); } else { registerReceiver( onDownloadComplete , new IntentFilter( DownloadManager . ACTION_DOWNLOAD_COMPLETE )); } Ref: StackOverflow

How to Send Crash Report to Email / Mobile Device in Android Java

Thread . setDefaultUncaughtExceptionHandler ( new Thread . UncaughtExceptionHandler () { @Override public void uncaughtException ( Thread thread, Throwable throwable) { // Handle uncaught exception sendCrashReport(throwable); } });   private void sendCrashReport ( Throwable throwable) { // Collect crash information StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter( sw ); throwable.printStackTrace( pw ); String crashReport = sw .toString(); // Compose email Intent emailIntent = new Intent( Intent . ACTION_SEND ); emailIntent .setType( "message/rfc822" ); emailIntent .putExtra( Intent . EXTRA_EMAIL , new String[]{ "sidbehala@gmail.com" }); emailIntent .putExtra( Intent . EXTRA_SUBJECT , "Crash Report" ); emailIntent .putExtra( Intent . EXTRA_TEXT , crashReport ); // Launch email intent startActivity( Intent . createChooser ( emailIntent , "Send crash rep...

How to fix error : Task :app:processDebugGoogleServices FAILED Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.example.appname'

PROBLEM: Task :app:processDebugGoogleServices FAILED Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.example.appname'  Solution: In my case: Google Services JSON file : Step: 1 => Go to https://console.firebase.google.com/  Create New Project / Choose existing project. Click on the Android icon to add a new app to your Firebase project. Enter your Android app's package name. Also Enter App Name (Nick Name) Click Register Button. Now, google-services.json file is ready for download. Step: 2 => Download the google-services.json file from the Google Developer Console Step: 3 => Place it in the app directory of your Android project

HOW TO DISCARD UNDER REVIEW APP BUNDLE AND UPLOAD NEW APP BUNDLE

Image
Google PlayConsole: Releases that have not yet been sent for review can now be discarded by managing your release. To discard releases already in review, or ready to be published, first remove changes on Publishing overview. Steps to discard changes 1) Publishing Overview => Remove Changes for Review 2) Publishing overview => Production => Release summary => Discard Release