我的应用程序只要在高于26的API上运行就可以正常运行,尽管只要它在低于26或等于26的任何API上运行,单击按钮就会崩溃,单击按钮会尝试注册/登录。 它不会在logcat上显示任何类型的错误消息。
我试图检查@ drawable-26文件夹,但我什至没有。
public class LoginActivity extends AppCompatActivity {
ProgressBar progressBar;
EditText email;
EditText password;
Button Register;
Button Login;
FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_login );
Objects.requireNonNull( getSupportActionBar() ).hide();
progressBar = findViewById( R.id.login_progress );
email = findViewById( R.id.email );
password = findViewById( R.id.password );
Register = findViewById( R.id.Register );
Login = findViewById( R.id.Login );
firebaseAuth = FirebaseAuth.getInstance();
Register.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent (LoginActivity.this, BottomActivity.class);
startActivity( intent );
progressBar.setVisibility( View.GONE );
firebaseAuth.createUserWithEmailAndPassword( email.getText().toString(), password.getText().toString())
.addOnCompleteListener( new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressBar.setVisibility( View.VISIBLE );
if(task.isSuccessful()) {
Toast.makeText(LoginActivity.this, "Registered Successfully", Toast.LENGTH_LONG).show();
email.setText( "" );
password.setText( "");
startActivity(new Intent(LoginActivity.this, BottomActivity.class));
} else {
Toast.makeText( LoginActivity.this, Objects.requireNonNull( task.getException() ).getMessage(), Toast.LENGTH_LONG).show();
startActivity( new Intent(LoginActivity.this, LoginActivity.class) );
}
}
} );
}
} );
Login.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity( new Intent(LoginActivity.this, LoginActivity2.class) );
}
});
}
}
您有我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.shrinkio">
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
android:name="android.support.multidex.MultiDexApplication">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.shrinkio.PersonListActivity" />
<activity
android:name=".LoginActivity2"
android:label="@string/title_activity_login2"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".Messages"
android:label="@string/title_activity_messages"
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".DashBoard"
android:label="@string/title_activity_dash_board" />
<activity
android:name=".BottomActivity"
android:label="@string/title_activity_bottom" />
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我目前遇到这些错误:
2019-05-02 20:56:41.847 15895-15895/com.example.shrinkio E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.shrinkio, PID: 15895
java.lang.RuntimeException: Unable to get provider com.crashlytics.android.CrashlyticsInitProvider: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at android.app.ActivityThread.installProvider(ActivityThread.java:6396)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:243)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:211)
at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
at io.fabric.sdk.android.Kit.initialize(Kit.java:69)
at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:466)
at io.fabric.sdk.android.Fabric.init(Fabric.java:410)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:368)
at io.fabric.sdk.android.Fabric.with(Fabric.java:339)
at com.crashlytics.android.CrashlyticsInitProvider.onCreate(CrashlyticsInitProvider.java:27)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
应该通过Firebase数据库注册我的应用程序,但是我得到的唯一是意外的应用程序崩溃。