我的应用程序一直在崩溃,但我无法弄清楚原因。 有人可以告诉我
我的Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.securitytechno2018"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-
android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main { java.srcDirs = ['src/main/java',
'src/main/java/com/securitytechno2018/listeners'] }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:cardview-v7:27.0.0'
implementation 'com.android.support:design:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.google.code.gson:gson:2.8.0'
}
apply plugin: 'com.google.gms.google-services'
我的logcat:
04-25 10:10:44.101 1621-1621/system_process I/InstallerConnection: connecting...
[ 04-25 10:10:44.102 1302: 1302 I/ ]
new connection
04-25 10:10:44.145 1621-1621/system_process I/InstallerConnection: disconnecting...
[ 04-25 10:10:44.145 1302: 1302 E/ ]
eof
[ 04-25 10:10:44.145 1302: 1302 E/ ]
failed to read size
[ 04-25 10:10:44.145 1302: 1302 I/ ]
closing connection
04-25 10:10:44.551 1621-1621/system_process I/InstallerConnection: connecting...
[ 04-25 10:10:44.551 1302: 1302 I/ ]
new connection
04-25 10:11:00.376 1621-1621/system_process W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection
04-25 10:11:48.189 2633-2658/com.securitytechno2018 E/FirebaseInstanceId: Google Play services missing or without correct permission.
04-25 10:11:48.252 2633-2633/com.securitytechno2018 V/FA: Cancelling job. JobID: 2074818501
04-25 10:11:48.256 2633-2633/com.securitytechno2018 V/FA: Registered activity lifecycle callback
04-25 10:11:48.311 2633-2633/com.securitytechno2018 V/FA: onActivityCreated
04-25 10:11:49.476 2633-2671/com.securitytechno2018 V/FA: Collection enabled
04-25 10:11:49.476 2633-2671/com.securitytechno2018 V/FA: App package, google app id: com.securitytechno2018, 1:702727695830:android:1ac1b0e480da2fe9
04-25 10:11:49.476 2633-2671/com.securitytechno2018 I/FA: App measurement is starting up, version: 11910
04-25 10:11:49.477 2633-2671/com.securitytechno2018 I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
04-25 10:11:49.478 2633-2671/com.securitytechno2018 I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.securitytechno2018
04-25 10:11:49.478 2633-2671/com.securitytechno2018 D/FA: Debug-level message logging enabled
04-25 10:11:49.505 2633-2671/com.securitytechno2018 V/FA: Checking service availability
04-25 10:11:49.518 2633-2671/com.securitytechno2018 W/FA: Service invalid
04-25 10:11:49.521 2633-2671/com.securitytechno2018 V/FA: Using local app measurement service
04-25 10:11:49.561 2633-2671/com.securitytechno2018 V/FA: Connection attempt already in progress
04-25 10:11:51.294 2633-2671/com.securitytechno2018 V/FA: Connection attempt already in progress
04-25 10:11:51.297 2633-2671/com.securitytechno2018 V/FA: Activity resumed, time: 77330
04-25 10:11:51.370 2633-2633/com.securitytechno2018 V/FA: Local AppMeasurementService is starting up
04-25 10:11:51.400 2633-2671/com.securitytechno2018 D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SplashScreen, firebase_screen_id(_si)=1354703464960186567}]
04-25 10:11:51.434 2633-2633/com.securitytechno2018 V/FA: Bound to IMeasurementService interface
04-25 10:11:51.508 2633-2671/com.securitytechno2018 V/FA: Connection attempt already in progress
04-25 10:11:51.509 2633-2671/com.securitytechno2018 V/FA: Connected to service
04-25 10:11:51.509 2633-2671/com.securitytechno2018 V/FA: Processing queued up service tasks: 4
04-25 10:11:51.525 2633-2671/com.securitytechno2018 I/FA: This instance being marked as an uploader
04-25 10:11:51.617 2633-2671/com.securitytechno2018 V/FA: Nothing to upload or uploading impossible
04-25 10:11:51.685 2633-2671/com.securitytechno2018 V/FA: Cancelling job. JobID: 2074818501
答案 0 :(得分:13)
尝试在真实设备上运行,该问题与模拟器或genymotion虚拟机有关。
检查是否已安装Google Play服务。
答案 1 :(得分:1)
下载google play service sdk并在清单中添加ACCESS_FINE_LOCATION权限(如果未添加)。
答案 2 :(得分:0)
在我的设备上使用Google地图时,我遇到了同样的错误。问题是我的模拟器中未安装Google Map Service。
只需在模拟器上添加Google Play服务。它将清除您的问题。
答案 3 :(得分:0)
是的,它需要您更喜欢真实android设备的真实设备来检查您的构建。您可以使用usb与Android手机连接并调试模式,还可以看到错误。