私は自分のアプリケーションでfirebase認証を使ってfacebookログインを追加しましたが、ログイン認証はAndroid API 24からしか動作しません。FacebookログインはAPI24からのみ動作します - com.google.firebase.authのローカルモジュール記述子クラスが見つかりません。エラー
低レベルのAPIを使用しようとすると画面がフリーズし、
これは高すぎます。ほとんどのユーザーは、API levelという値を持っています。
実際、私はAPIレベルを下げるためにアプリケーションをリリースするつもりです。
私が使用しているコードは次のとおりです。
12月2日午後5時22:プロジェクトで使用されるすべてのオブジェクトは
API 23ログ上に記載されています** MyApplicationという活動に
import android.app.Application; import android.content.Context;
を使用
public class ConfigurationActivity extends Activity { Button b_v_mm,b_som; LoginButton loginButton; CallbackManager callbackManager; // [START declare_auth] private FirebaseAuth mAuth; // [END declare_auth] private void handleFacebookAccessToken(AccessToken token) { Log.d("FireBase", "handleFacebookAccessToken:" + token); AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken()); mAuth.signInWithCredential(credential) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { // Sign in success, update UI with the signed-in user's information Log.d("FireBase", "signInWithCredential:success"); FirebaseUser user = mAuth.getCurrentUser(); //updateUI(user); } else { // If sign in fails, display a message to the user. Log.w("FireBase", "signInWithCredential:failure", task.getException()); //Toast.makeText(FacebookLoginActivity.this, "Authentication failed.", // Toast.LENGTH_SHORT).show(); //updateUI(null); } // ... } }); } // [START on_start_check_user] @Override public void onStart() { super.onStart(); Log.d("FireBase", "onStart"); // Check if user is signed in (non-null) and update UI accordingly. FirebaseUser currentUser = mAuth.getCurrentUser(); //updateUI(currentUser); } // [END on_start_check_user] @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d("LoginFace", "LoginFace - onActivityResult"); super.onActivityResult(requestCode, resultCode, data); Log.d("LoginFace", "LoginFace - onActivityResult"); callbackManager.onActivityResult(requestCode, resultCode, data); Log.d("LoginFace", "LoginFace - After callbackManager"); /* if (AccessToken.getCurrentAccessToken() != null) { Log.d("AjudaFace", "AjudaFace - logout"); LoginManager.getInstance().logOut(); }*/ } protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_configuration); //Botãp da barra de ferramentas que faz retornar para o Menu principal. b_v_mm = (Button) findViewById(com.cerveja.qof.pedro.qof_cerveja.R.id.b_v_mm); b_v_mm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(ConfigurationActivity.this, MainMenu.class); startActivity(intent); finish(); } }); b_som = (Button) findViewById(com.cerveja.qof.pedro.qof_cerveja.R.id.b_som); //Altera opções de som. b_som.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Carrega opções de texto do botão, armazenadas no repositório de strings String s_som_on = getString(R.string.b_som_on); String s_som_off = getString(R.string.b_som_off); //Caso o som esteja desligado, o desliga. if(b_som.getText().equals(s_som_on)) { b_som.setText(s_som_off); } else //Caso o som esteja desligado, o liga. if (b_som.getText().equals(s_som_off)){ b_som.setText(s_som_on); } } } ); callbackManager = CallbackManager.Factory.create(); // ... // Initialize Firebase Auth mAuth = FirebaseAuth.getInstance(); loginButton = (LoginButton) findViewById(R.id.login_button); loginButton.setReadPermissions("email","public_profile"); Log.d("LoginFace", "LoginFace - Button Created"); // Callback registration loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { handleFacebookAccessToken(loginResult.getAccessToken()); Log.d("LoginFace", "LoginFace - Sucesso"); Toast.makeText(getApplicationContext(), "LOGIN REALIZADO", Toast.LENGTH_LONG).show(); } @Override public void onCancel() { Log.d("LoginFace", "LoginFace - Cancelado"); Toast.makeText(getApplicationContext(), "LOGIN CANCELADO", Toast.LENGTH_LONG).show(); } @Override public void onError(FacebookException exception) { Log.d("LoginFace", "LoginFace - Erro"); Toast.makeText(getApplicationContext(), "LOGIN Erro", Toast.LENGTH_LONG).show(); Log.d("LoginFace", exception.toString()); } }); } }
オブジェクト:26.900 2668-2745 /? D/EGL_emulation:eglMakeCurrent: 0xaa9ba4e0:2 0(0xac3853a0 TINFO)
[ 12-02 17:22:26.949 2668: 3361 D/ ] HostConnection::get() New Host Connection established 0xa19c5800, tid 3361 [ 12-02 17:22:26.950 2668: 3361 W/ ] Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1
版ANDROID_EMU_dma_v1 12月2日17:22:26.977 2668から3361 /? D/EGL_emulation: eglCreateContext:0xaa9ba900:maj 2分0 rcv 2 12-02 17:22:26.978 2668-3361 /? D/EGL_emulation:eglMakeCurrent:0xaa9ba900:ver 2 0 (tinfo 0xa23bf7e0)12-02 17:22:26.980 2668-3361 /? E/eglCodecCommon: glUtilsParamSize:パラメータを知らない0x00008cdf 12-02 17:22:26.980 2668-3361 /? E/eglCodecCommon:glUtilsParamSize:パラメータを知らない 0x00008824 12-02 17:22:26.980 2668-3361 /? E/eglCodecCommon: glUtilsParamSize:パラメータを知らない0x00008cdf 12-02 17:22:26.980 2668-3361 /? E/eglCodecCommon:glUtilsParamSize:パラメータを知らない 0x00008824 12-02 17:22:27.135 2668-3361 /? D/EGL_emulation: eglCreateContext:0xaa9ba9c0:maj 2分0 rcv 2 12-02 17:22:27.136 2668-3361 /? D/EGL_emulation:eglMakeCurrent:0xaa9ba9c0:ver 2 0 (tinfo 0xa23bf7e0)12-02 17:22:29.740 2668-2668/com.cerveja.qof.pedro.qof_cerveja W/BindingManager:できません を呼び出す決定されたビジビリティ() - 決してpidの接続を確認しました:2668 12-02 17:22:32.649 2668-2745/com.cerveja.qof.pedro.qof_cerveja D/EGL_emulation:eglMakeCurrent:0xaa9ba4e0:ver 2 0(tinfo 0xac3853a0)12-02 17:22:32.650 2668-2745/com.cerveja.qof.pedro.qof_cerveja E/Surface: getSlotFromBufferLocked:未知バッファ:0xb40bdc00 12-02 17:22:32.676 2668-3361/com.cerveja.qof.pedro .qof_cerveja D/EGL_emulation: eglMakeCurrent:0xaa9ba900:ver 2 0(tinfo 0xa23bf7e0)12-02 17:22:32.687 26 68から3361/com.cerveja.qof.pedro.qof_cerveja D/EGL_emulation:eglMakeCurrent:0xaa9ba9c0:22:32.704 2668から2745/com.cerveja.qof.pedro( 0xa23bf7e0 TINFO)2 0 12から02 17版.qof_cerveja D/EGL_emulation: eglMakeCurrent:0xaa9ba4e0:22:32.716 2668から2745/com.cerveja.qof.pedro.qof_cerveja E/eglCodecCommon:glUtilsParamSize:unknowのparam 0x00008cdf(0xac3853a0 TINFO)2 0 12から02 17版12-02 17:22:32.767 2668-3361/com.cerveja.qof.pedro。qof_cerveja D/EGL_emulation:eglMakeCurrent:0xaa9ba900:27:05.115 2668から2711/com.cerveja.qof.pedro.qof_cervejaのW/DynamiteModule:2 0 12から02 17(0xa23bf7e0 TINFO)版のローカル モジュール記述子クラスcom.google.firebase.authが見つかりません。
この最後の一つは、おそらくエラーの原因である:
12月2日17:27:05.115 2668年から2711年/ com.cerveja.qof.pedro.qof_cervejaのW/DynamiteModule:COMのローカルモジュール記述子クラス.google.firebase.authが見つかりません。
必要なAPIレベルを下げるにはどうすればよいですか?
を無効にする可能性がある必要があります15とその魅力のような働き – androidXP
あなたのデバイスの依存関係やGoogle Playサービスのバージョンに問題がある可能性があります。 APIが23未満のデバイスで何が失敗しているのかを詳しく説明してください。 –
どうすれば探せますか?アプリケーションはちょうどフリーズし、logcatのエラーを指摘しません。 – Siqueira