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!