小编Sus*_*was的帖子

com.google.firebase.FirebaseException:发生内部错误。[ API 密钥无效。请传递有效的 API 密钥。]

我删除了旧的 fire-base 项目并创建了一个新项目。之后我收到了这个错误。

第一个错误是 sha 1 这就是为什么我删除旧项目并创建新项目的原因。

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.firebase.ui.auth.AuthUI;
import com.google.firebase.auth.FirebaseAuth;

import java.util.Arrays;

public class MainActivity extends AppCompatActivity {public static final int RC_SIGN_IN = 1;


private FirebaseAuth mFirebaseAuth;
private FirebaseAuth.AuthStateListener mAuthStateListener;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mFirebaseAuth = FirebaseAuth.getInstance();

    startActivityForResult(
            // Get an instance of AuthUI based on the default app
            AuthUI.getInstance()
                    .createSignInIntentBuilder()
                    .setAvailableProviders(Arrays.asList(
                            new AuthUI.IdpConfig.EmailBuilder().build(),
                            new AuthUI.IdpConfig.PhoneBuilder().build(),
                            new AuthUI.IdpConfig.GoogleBuilder().build()
                    ))
                    .setIsSmartLockEnabled(!BuildConfig.DEBUG /* credentials */, true /* hints */)
                    .build(),
            RC_SIGN_IN);
 }

} …
Run Code Online (Sandbox Code Playgroud)

android

11
推荐指数
3
解决办法
2万
查看次数

ActionChains 中的 perform() 和 reset_actions() 不起作用 selenium python

这是没有错误的代码:

perform() 和 reset_actions()

但这两个功能必须结合使用

import os
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import random

# Setting the chrome_options
global chrome_options
chrome_options = Options()
chrome_options.add_argument("--start-maximized")
chrome_options.add_argument('--profile-directory=Default')
prefs = {"profile.default_content_setting_values.notifications": 2}
chrome_options.add_experimental_option("prefs", prefs)
chrome_options.add_argument('disable-infobars')
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])

google_search = [
    "1.' driver.switch_to.active_element' ",
    "2.this code is a one of important snippet for facebook automation.",
]

random_google_search = random.choice(google_search)

# Setting the Chrome Driver
global driver
driver = webdriver.Chrome("chromedriver.exe", …
Run Code Online (Sandbox Code Playgroud)

python selenium

7
推荐指数
1
解决办法
285
查看次数

您需要为您的 APK 或 Android App Bundle 使用不同的版本代码,因为您已经有一个版本代码为 1 的

我想发布我的 android 应用程序的更新版本。

当我上传它给我这个警告。

很多文章都显示如果我在清单文件中添加版本号,它就可以工作。

就我而言,它仍然无法正常工作。

android

3
推荐指数
1
解决办法
5417
查看次数

Keys.BACK_SPACE 或 Keys.TAB 发送密钥在 facebook selenium python 上不起作用

我正在编写一些硒代码来导航 Facebook。

import os
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys


def driver():
    global driver
    driver = webdriver.Chrome("chromedriver.exe", chrome_options=chrome_options)
    driver.get("https://facebook.com")


def chrome_options():
    global chrome_options
    chrome_options = Options()
    chrome_options.add_argument("--start-maximized")
    chrome_options.add_argument('--profile-directory=Default')
    # chrome_options.add_argument("--user-data-dir=chrome-data")
    prefs = {"profile.default_content_setting_values.notifications": 2}
    chrome_options.add_experimental_option("prefs", prefs)
    chrome_options.add_argument('disable-infobars')
    chrome_options.add_experimental_option("useAutomationExtension", False)
    chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])


def actions():
    global actions
    actions = ActionChains(driver)


def login():
    try:
        # I use environment veriable  base on this tutorials https://www.youtube.com/watch?v=IolxqkL7cD8
        username = os.environ.get('my_facebook_username')
        password = os.environ.get('my_facebook_password')

        driver.find_element_by_name("email").send_keys(username) …
Run Code Online (Sandbox Code Playgroud)

python selenium

2
推荐指数
1
解决办法
177
查看次数

标签 统计

android ×2

python ×2

selenium ×2