Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: You are not allowed here! #11

Open
mmck345 opened this issue Nov 25, 2020 · 24 comments
Open

ERROR: You are not allowed here! #11

mmck345 opened this issue Nov 25, 2020 · 24 comments

Comments

@mmck345
Copy link

mmck345 commented Nov 25, 2020

I have read here all the questions and answers asked, but I still can not solve my problem
I built the project properly and installed it on my Android device and after email verification I get the error: You are not allowed here!
I looked at other people's questions and did what was written there, I used an original copy of the storage-public.rules and storage-public.rules files and added a uid name of the project manager in Firebase and when I log in from the management email I get an error " You are not allowed here "

Screenshot_1

Maybe I was wrong about something? I would love for you to help me what should I do please?
Thank you very much!
Sorry for my bad English this is not my everyday language ..

@SimonMarquis
Copy link
Owner

Hi,
If you have this message on your Android app, it means your user did not validate its email.

else -> {
Log.e(TAG, "Current user not allowed")
Firebase.auth.signOut()
Toast.makeText(this@ApplicationsActivity, R.string.applications_toast_not_allowed, Toast.LENGTH_LONG).show()
wipeAndExit()
return

Did you correctly configured your app to target your own store, and your user registered on a compatible AuthProvider (Google for instance)?

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

I set up an email login method

image

At the first login I received a verification email and opened the link to verify the email address.
Then every time I log in to the app I am asked to enter my email address and password and immediately receive this error toast

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

I'm using Windows and did not understand exactly what to do at this stage of your tutorial

image
image

Could it be related to the error I'm getting now?

@SimonMarquis
Copy link
Owner

If you've build a "public" store, you should be able to acces the store content without logging.
Is it the case?

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

At the moment I can not enter the store without a user ID (I really want this to be the case in the future with this store) but the problem is that even after verification there is no access to the store ...
Do you think I will try to define the store as "public" and then see if it is possible to enter or not?
Can you guide me how to set the store to "public"?

@SimonMarquis
Copy link
Owner

SimonMarquis commented Nov 25, 2020

Then why did you use the "public" schemas instead of the "private" ones?

used an original copy of the storage-public.rules and storage-public.rules

Also, did you publish your schemas to your firebase instance?

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

I defined both files as both public and private

image

@SimonMarquis
Copy link
Owner

I think you did not upload these files to your firebase instance.
I strongly encourage you to take a look at the official firebase documentation on how to initialize/configure Firebase RealtimeDatabase / Storage / Authentication.
Everything is better expained over there.

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

Also, did you publish your schemas to your firebase instance?

I'm so sorry for my questions if they's simple, but I'd love for you to help me with that. I'm new to programming and Firebase.
What should I do I did not understand what you mean?

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

I think you did not upload these files to your firebase instance.
I strongly encourage you to take a look at the official firebase documentation on how to initialize/configure Firebase RealtimeDatabase / Storage / Authentication.
Everything is better expained over there.

Okay thank you very much I will check it out hope I succeed.

@mmck345
Copy link
Author

mmck345 commented Nov 25, 2020

I think you did not upload these files to your firebase instance.

Thank you dear Simon, I went through the documentation you told me to review and that's really what I'm missing..
I fixed this I posted the file on firebase

image

And I'm currently logged in from the user I defined as an administrator by specifying the UID in the rules file and it logs in and displays the application page. Of course there is currently nothing there, how can I add apps to my storage so that all users can see and install them?

After the whole process in the CLI terminal it output an error I got

image

@SimonMarquis
Copy link
Owner

Firebase Function, used in this project to send notifications to users when a new app or version is available, requires you to enable Billing support for your project.
Firebase Function is not required though for the AppStore to work.

Now, as admin user and on the web app, you should have a + button in the main screen to add a new app. (You can't do that from the android app)
https://github.com/SimonMarquis/InternalAppStore/blob/master/art/web_applications_admin.png

@mmck345
Copy link
Author

mmck345 commented Nov 30, 2020

Firebase Function, used in this project to send notifications to users when a new app or version is available, requires you to enable Billing support for your project.
Firebase Function is not required though for the AppStore to work.

Now, as admin user and on the web app, you should have a + button in the main screen to add a new app. (You can't do that from the android app)
https://github.com/SimonMarquis/InternalAppStore/blob/master/art/web_applications_admin.png

Hello Simon Thanks for your help so far I'm glad I've made more progress.
I currently have a few small things left, I hope I'm about to finish the project ..
The first thing I can not deploy the web app,
I can see it working fine by the firebase submission command and log in to http://localhost:5000

So I see the store properly

image

[But for some reason even when I log in through the user name defined as an administrator in Firebase I do not see the button of adding new applications]

But the firebase deploy command brings up such output and the site intended for the web application remains empty

image

What's the problem with me? I would love if you could guide me in solving the problem, thank you very much!

The second problem concerns the Android app, I run the app from Android Studio in debugging mode on a physical device and the app closes a few moments after it goes into action, below is the debugging log output:

E/AndroidRuntime: FATAL EXCEPTION: main Process: qin.premium.appstore, PID: 2865 java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/qin.premium.appstore-1.apk"],nativeLibraryDirectories=[/data/app-lib/qin.premium.appstore-1, /vendor/lib, /system/lib]] at android.app.ActivityThread.installProvider(ActivityThread.java:4793) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325) at android.app.ActivityThread.access$1500(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) **Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/qin.premium.appstore-1.apk"],nativeLibraryDirectories=[/data/app-lib/qin.premium.appstore-1, /vendor/lib, /system/lib]]** at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at android.app.ActivityThread.installProvider(ActivityThread.java:4778) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)  at android.app.ActivityThread.access$1500(ActivityThread.java:135)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5017)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)  at dalvik.system.NativeStart.main(Native Method) 

Thank you so much for all the help you are a special person who loves to help! I appreciate it!

@SimonMarquis
Copy link
Owner

Hi,

The first thing I can not deploy the web app,

Run this command instead, it will deploy everything you need but the functions:
firebase deploy --only "database,storage,hosting"

Also, if you don't have the + button, it means your user uid is not correctly registered in the firebase database.
Double check that from the firebase database explorer.

For the app error, try to run it on a release build type, otherwise checkout this stackoverflow issue.

@mmck345
Copy link
Author

mmck345 commented Dec 5, 2020

Good week thanks for all your help
I deployed the project and everything looks cool, now I'm trying to update my UID in the database rules and that's the error I get

image

I tried a lot to change the syntax and also google what my problem is and did not find a solution that works, thank you very much for your help!

@SimonMarquis
Copy link
Owner

You are editing the Rules file instead of the Data file. (look at the tabs)

@mmck345
Copy link
Author

mmck345 commented Dec 5, 2020

You are editing the Rules file instead of the Data file. (look at the tabs)

Oh sorry what a mistake .. Thank you very much!

image

But in the data I have already set the UID of a manager and yet I do not see the + button in the web app

@SimonMarquis
Copy link
Owner

This is not the correct format, instead you should have:
image

@mmck345
Copy link
Author

mmck345 commented Dec 5, 2020

This is not the correct format, instead you should have:
...

image

Hi I succeeded 👍👍 Thank you so much, you are a really lovely man!

@mmck345
Copy link
Author

mmck345 commented Dec 10, 2020

Hi Simon,
I want give the store permission to install and remove apps without having to be dependent on a package installer located on Android, I will note that the store will serve as a system app on the device I am working on.
You are know to help me?
Thenk you.

@SimonMarquis
Copy link
Owner

Hi, unfortunately I don't know how this can be achieved as I currently rely on the system package installer.

@mmck345
Copy link
Author

mmck345 commented Feb 4, 2021

Hi Simon
Something seems to get complicated when I try to deploy the function library, the command ends with such an error;

> firebase deploy --only functions

=== Deploying to '-....-app-store'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
Error: double-loading config "C:\Users\developer\.cache\firebase\runtime\npmrc" as "global", previously loaded as "user"
    at Config.[loadObject] (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:417:13)
    at C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:445:32
    at async Config.[loadFile] (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:444:5)
    at async Config.load (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:233:5)
    at async Object.[_load] (C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\npm.js:179:5)
Error: call config.load() before reading values
    at Config.get (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:163:13)
    at errorHandler (C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\utils\error-handler.js:171:32)
    at Object.<anonymous> (C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\cli.js:42:14)
    at Object.onceWrapper (events.js:422:26)
    at Object.emit (events.js:315:20)
    at C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\npm.js:154:12
Error: call config.load() before reading values
    at Config.get (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:163:13)
    at process.errorHandler (C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\utils\error-handler.js:171:32)
    at process.emit (events.js:315:20)
    at processPromiseRejections (internal/process/promises.js:209:33)
    at processTicksAndRejections (internal/process/task_queues.js:98:32)
C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:163
      throw new Error('call config.load() before reading values')
      ^

Error: call config.load() before reading values
    at Config.get (C:\Users\developer\.cache\firebase\tools\node_modules\npm\node_modules\@npmcli\config\lib\index.js:163:13)
    at process.errorHandler (C:\Users\developer\.cache\firebase\tools\node_modules\npm\lib\utils\error-handler.js:171:32)
    at process.emit (events.js:315:20)
    at process._fatalException (internal/process/execution.js:165:25)

Error: functions predeploy error: Command terminated with non-zero exit code7

I searched a lot and saw more who encountered a similar problem but the solutions offered there unfortunately did not work for me ..
I would love your help thank you very much!

@SimonMarquis
Copy link
Owner

I have no idea why there is an error.
Maybe try those things:

  • disable the lint command
  • update npm dependencies
  • invalidate the whole npm_modules

@smmcdonald
Copy link

smmcdonald commented Jul 28, 2023

I had this issue in an Azure DevOps pipeline running on a Linux VM. I was installing firebase-tools with a curl call in Bash:

  - bash: |
     curl -sL https://firebase.tools | bash

The pipeline would fail with the originally posted error when running the pre-deploy lint for Firebase Functions deploy:

Running command: npm --prefix "$RESOURCE_DIR" run lint:fix

The fix was to install firebase-tools with NPM, like so:

- task: Bash@3
      displayName: Install Firebase Tools
      inputs:
        targetType: 'inline'
        script: |
          npm install -g firebase-tools

This leads me to believe this error is a misnomer for issues with the scripts in the package.json. I hope this helps someone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants