Not Receiving OTP from FireBase from second Time2019 Community Moderator ElectionStop EditText from gaining focus at Activity startupAndroid error: Failed to install *.apk on device *: timeoutError retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23Firebase OTP Auth messages are differing in iOS and AndroidFirebase is not sending otp properlyNot getting OTP using Firebase passwordless Authenticationfirebase OTP is not receiving for international numbersGetting OTP after Phone RestartsRegistration in Firebase using OTPAndroid App Firebase OTP Verification Issue

Why do newer 737s use two different styles of split winglets?

How to pronounce "I ♥ Huckabees"?

Aluminum electrolytic or ceramic capacitors for linear regulator input and output?

Why is the President allowed to veto a cancellation of emergency powers?

Most cost effective thermostat setting: consistent temperature vs. lowest temperature possible

What is the adequate fee for a reveal operation?

Have the tides ever turned twice on any open problem?

PTIJ: Who should I vote for? (21st Knesset Edition)

Print a physical multiplication table

Four married couples attend a party. Each person shakes hands with every other person, except their own spouse, exactly once. How many handshakes?

How to make healing in an exploration game interesting

Bach's Toccata and Fugue in D minor breaks the "no parallel octaves" rule?

Why Choose Less Effective Armour Types?

Are Roman Catholic priests ever addressed as pastor

Do the common programs (for example: "ls", "cat") in Linux and BSD come from the same source code?

Brexit - No Deal Rejection

Violin - Can double stops be played when the strings are not next to each other?

Knife as defense against stray dogs

What is the meaning of まっちろけ?

Is Manda another name for Saturn (Shani)?

Is there a place to find the pricing for things not mentioned in the PHB? (non-magical)

Simplify an interface for flexibly applying rules to periods of time

How to write cleanly even if my character uses expletive language?

Do I need life insurance if I can cover my own funeral costs?



Not Receiving OTP from FireBase from second Time



2019 Community Moderator ElectionStop EditText from gaining focus at Activity startupAndroid error: Failed to install *.apk on device *: timeoutError retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23Firebase OTP Auth messages are differing in iOS and AndroidFirebase is not sending otp properlyNot getting OTP using Firebase passwordless Authenticationfirebase OTP is not receiving for international numbersGetting OTP after Phone RestartsRegistration in Firebase using OTPAndroid App Firebase OTP Verification Issue










0















I am trying to receive OTP number from Firebase using Android App. I am getting OTP every time after phone restarts and after that I am not getting any OTP. Any help is highly appreciated. My project contains below four activities.



Options Tried to resolve this issue



  1. Cleared the Data on the phone. Its same issue for other users too.









share|improve this question




























    0















    I am trying to receive OTP number from Firebase using Android App. I am getting OTP every time after phone restarts and after that I am not getting any OTP. Any help is highly appreciated. My project contains below four activities.



    Options Tried to resolve this issue



    1. Cleared the Data on the phone. Its same issue for other users too.









    share|improve this question


























      0












      0








      0








      I am trying to receive OTP number from Firebase using Android App. I am getting OTP every time after phone restarts and after that I am not getting any OTP. Any help is highly appreciated. My project contains below four activities.



      Options Tried to resolve this issue



      1. Cleared the Data on the phone. Its same issue for other users too.









      share|improve this question
















      I am trying to receive OTP number from Firebase using Android App. I am getting OTP every time after phone restarts and after that I am not getting any OTP. Any help is highly appreciated. My project contains below four activities.



      Options Tried to resolve this issue



      1. Cleared the Data on the phone. Its same issue for other users too.






      android firebase firebase-authentication one-time-password






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 12 at 7:52







      Jo.........

















      asked Mar 5 at 23:30









      Jo.........Jo.........

      608




      608






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You should first remove



           FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();


          Shouldn't be called 5 times in a row. Just do it once and in onStop method:



          override fun onStop() 
          super.onStop()
          FirebaseAuth.getInstance().signOut()



          I think you should then set



          FirebaseApp.initializeApp(this);


          only once and be sure to put this preferably in your custom Application class:



          class CustomApplication : Application() 
          override fun onCreate()
          super.onCreate()

          /**
          * Firebase Initialization code
          * **/

          FirebaseApp.initializeApp(this)



          Then, in your Manifest.xml file:



          <application
          android:name=".CustomApplication"
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme">


          ....
          ....



          </application>


          Official Firebase github Repo



          In addition, be sure to check out the example code for Firebase/quickstart-android - PhoneAuthActivity for phone authentication of the official repository:
          quickstart-android for phone authentication



          You should then be ready to go with proper phone authentication implementation with Firebase.






          share|improve this answer

























          • Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

            – Jo.........
            Mar 6 at 5:27











          • Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

            – Jo.........
            Mar 6 at 18:13











          • @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

            – Mobile First Solutions
            Mar 6 at 18:24











          • What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

            – Jo.........
            Mar 6 at 20:51











          • When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

            – Mobile First Solutions
            Mar 6 at 20:57










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55013254%2fnot-receiving-otp-from-firebase-from-second-time%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You should first remove



           FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();


          Shouldn't be called 5 times in a row. Just do it once and in onStop method:



          override fun onStop() 
          super.onStop()
          FirebaseAuth.getInstance().signOut()



          I think you should then set



          FirebaseApp.initializeApp(this);


          only once and be sure to put this preferably in your custom Application class:



          class CustomApplication : Application() 
          override fun onCreate()
          super.onCreate()

          /**
          * Firebase Initialization code
          * **/

          FirebaseApp.initializeApp(this)



          Then, in your Manifest.xml file:



          <application
          android:name=".CustomApplication"
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme">


          ....
          ....



          </application>


          Official Firebase github Repo



          In addition, be sure to check out the example code for Firebase/quickstart-android - PhoneAuthActivity for phone authentication of the official repository:
          quickstart-android for phone authentication



          You should then be ready to go with proper phone authentication implementation with Firebase.






          share|improve this answer

























          • Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

            – Jo.........
            Mar 6 at 5:27











          • Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

            – Jo.........
            Mar 6 at 18:13











          • @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

            – Mobile First Solutions
            Mar 6 at 18:24











          • What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

            – Jo.........
            Mar 6 at 20:51











          • When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

            – Mobile First Solutions
            Mar 6 at 20:57















          1














          You should first remove



           FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();


          Shouldn't be called 5 times in a row. Just do it once and in onStop method:



          override fun onStop() 
          super.onStop()
          FirebaseAuth.getInstance().signOut()



          I think you should then set



          FirebaseApp.initializeApp(this);


          only once and be sure to put this preferably in your custom Application class:



          class CustomApplication : Application() 
          override fun onCreate()
          super.onCreate()

          /**
          * Firebase Initialization code
          * **/

          FirebaseApp.initializeApp(this)



          Then, in your Manifest.xml file:



          <application
          android:name=".CustomApplication"
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme">


          ....
          ....



          </application>


          Official Firebase github Repo



          In addition, be sure to check out the example code for Firebase/quickstart-android - PhoneAuthActivity for phone authentication of the official repository:
          quickstart-android for phone authentication



          You should then be ready to go with proper phone authentication implementation with Firebase.






          share|improve this answer

























          • Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

            – Jo.........
            Mar 6 at 5:27











          • Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

            – Jo.........
            Mar 6 at 18:13











          • @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

            – Mobile First Solutions
            Mar 6 at 18:24











          • What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

            – Jo.........
            Mar 6 at 20:51











          • When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

            – Mobile First Solutions
            Mar 6 at 20:57













          1












          1








          1







          You should first remove



           FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();


          Shouldn't be called 5 times in a row. Just do it once and in onStop method:



          override fun onStop() 
          super.onStop()
          FirebaseAuth.getInstance().signOut()



          I think you should then set



          FirebaseApp.initializeApp(this);


          only once and be sure to put this preferably in your custom Application class:



          class CustomApplication : Application() 
          override fun onCreate()
          super.onCreate()

          /**
          * Firebase Initialization code
          * **/

          FirebaseApp.initializeApp(this)



          Then, in your Manifest.xml file:



          <application
          android:name=".CustomApplication"
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme">


          ....
          ....



          </application>


          Official Firebase github Repo



          In addition, be sure to check out the example code for Firebase/quickstart-android - PhoneAuthActivity for phone authentication of the official repository:
          quickstart-android for phone authentication



          You should then be ready to go with proper phone authentication implementation with Firebase.






          share|improve this answer















          You should first remove



           FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();
          FirebaseAuth.getInstance().signOut();


          Shouldn't be called 5 times in a row. Just do it once and in onStop method:



          override fun onStop() 
          super.onStop()
          FirebaseAuth.getInstance().signOut()



          I think you should then set



          FirebaseApp.initializeApp(this);


          only once and be sure to put this preferably in your custom Application class:



          class CustomApplication : Application() 
          override fun onCreate()
          super.onCreate()

          /**
          * Firebase Initialization code
          * **/

          FirebaseApp.initializeApp(this)



          Then, in your Manifest.xml file:



          <application
          android:name=".CustomApplication"
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme">


          ....
          ....



          </application>


          Official Firebase github Repo



          In addition, be sure to check out the example code for Firebase/quickstart-android - PhoneAuthActivity for phone authentication of the official repository:
          quickstart-android for phone authentication



          You should then be ready to go with proper phone authentication implementation with Firebase.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 6 at 20:53

























          answered Mar 6 at 0:28









          Mobile First SolutionsMobile First Solutions

          112




          112












          • Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

            – Jo.........
            Mar 6 at 5:27











          • Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

            – Jo.........
            Mar 6 at 18:13











          • @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

            – Mobile First Solutions
            Mar 6 at 18:24











          • What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

            – Jo.........
            Mar 6 at 20:51











          • When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

            – Mobile First Solutions
            Mar 6 at 20:57

















          • Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

            – Jo.........
            Mar 6 at 5:27











          • Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

            – Jo.........
            Mar 6 at 18:13











          • @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

            – Mobile First Solutions
            Mar 6 at 18:24











          • What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

            – Jo.........
            Mar 6 at 20:51











          • When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

            – Mobile First Solutions
            Mar 6 at 20:57
















          Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

          – Jo.........
          Mar 6 at 5:27





          Thanks for your comment bu I tried this solution but it didn't help me to resolve this issue.

          – Jo.........
          Mar 6 at 5:27













          Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

          – Jo.........
          Mar 6 at 18:13





          Step:1 I have removed all the multiple signout and included onStop() method. Step:2 I have included intializeApp method Step:3 I have changed my manifest file

          – Jo.........
          Mar 6 at 18:13













          @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

          – Mobile First Solutions
          Mar 6 at 18:24





          @Josh Steps you should consider in order to solve your issue: 1) Move FirebaseApp.initializeApp(this) to CustomApplication class. 2) Add CustomApplication class name in Manifest. 3) In MainActivity, remove FirebaseAuth.getInstance().signOut() from onCreate and put it eventually in onStop. 4) In order to get the phonenumber (after successfully OTP), put back intent.putExtra("phonenumber", phonenumber) when task.isSuccessful(). 5) Change (reorder) the logic of your Logout to SignOut from FirebaseAuth only when LogOut Button is clicked

          – Mobile First Solutions
          Mar 6 at 18:24













          What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

          – Jo.........
          Mar 6 at 20:51





          What kind of action does CustomApplication perform? I am not sure about EmojiManage and MapBox

          – Jo.........
          Mar 6 at 20:51













          When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

          – Mobile First Solutions
          Mar 6 at 20:57





          When every Android Application run, the class Application is launched first. You can override this class (the name CustomApplication is arbitrary, you can choose any name you want). When you override Application class, you can do additional initialization. The code I put first was an example of the initialization of multiple libraries. In your case, just put class CustomApplication : Application() override fun onCreate() super.onCreate() /** * Firebase Initialization code * **/ FirebaseApp.initializeApp(this)

          – Mobile First Solutions
          Mar 6 at 20:57



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55013254%2fnot-receiving-otp-from-firebase-from-second-time%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко