0

I have created an android app, and it ran successfully on my device. However, when I created a signed apk and installed the same in my device, the app is not running. On checking logs, I see

java.lang.IllegalArgumentException: Invalid topic name: does not match the allowed format

final SharedPreferences sharedPreferences = getSharedPreferences("SchoolInfo", MODE_PRIVATE);
final String schoolID = sharedPreferences.getString("SchoolID", "");
FirebaseMessaging.getInstance().subscribeToTopic(schoolID);

The error is on the 3rd line. The schoolID generated is "-M0iGJYrdlMDE4htslAv"

My questions are: 1.If this is a general error why is it not coming when I run the app in my device from android studio(without installing the apk)? The schoolID is the same during both the cases. 2. What can be done to resolve this issue?

Any help would be really appreciated!

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
mayur
  • 374
  • 1
  • 10
  • You have an invalid character somewhere. Please make sure you're only using valid characters for the topic name. – Doug Stevenson Feb 25 '20 at 16:54
  • Then it should throw error when I'm running the app through android studio. But it's not the case – mayur Feb 25 '20 at 18:08
  • You'll have to add some debug logging to figure out what exactly it's complaining about. If you think the error message is incorrect, contact Firebase support directly with reproduction steps that anyone can use to see the same issue. https://support.google.com/firebase/contact/support – Doug Stevenson Feb 25 '20 at 18:32

0 Answers0