测验模块在Android模拟器上运行,但在Android设备上没有

时间:2018-02-12 18:26:04

标签: java android

测验模块在Android模拟器上运行但在Android设备上没有。我在模拟器上运行android nougat和api 27。这是build.gradle。唯一的问题是,当我在模拟器上打开测验模块时,它运行良好。但在我的设备中它会关闭应用程序。

android {
    compileSdkVersion 27
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId "com.example.stitaft.datarial"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        lintOptions {
            abortOnError false
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // Glide image library
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.squareup.okhttp3:parent:3.8.1'
    compile 'com.google.code.gson:gson:2.8.1'
    compile 'com.squareup.okhttp3:okhttp:3.8.1'
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
    compile 'com.github.barteksc:android-pdf-viewer:2.3.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

这是运行日志。但是没有logcat错误,我不知道为什么。

02/13 02:28:52: Launching app
$ adb push C:\Users\Timoooow\Desktop\fix\DATARIAL\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.example.stitaft.datarial
$ adb shell pm install -t -r "/data/local/tmp/com.example.stitaft.datarial"
    pkg: /data/local/tmp/com.example.stitaft.datarial
Success


$ adb shell am start -n "com.example.stitaft.datarial/com.example.stitaft.datarial.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 8210 on device asus-p01v-FBNPFP015860
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Background sticky concurrent mark sweep GC freed 42497(1815KB) AllocSpace objects, 0(0B) LOS objects, 19% free, 4MB/5MB, paused 4.994ms total 107.476ms
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FA: App measurement is starting up, version: 11020
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
V/FA: Collection enabled
V/FA: App package, google app id: com.example.stitaft.datarial, 1:763239624265:android:6f1303d43fb6228a
I/FA: To enable faster debug mode event logging run:
        adb shell setprop debug.firebase.analytics.app com.example.stitaft.datarial
D/FA: Debug-level message logging enabled
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: Persisting first open: 1518459857646
V/FA: State of service unknown
V/FA: Checking service availability
V/FA: Service available
V/FA: Setting useService: true
V/FA: Using measurement service
V/FA: Connecting to remote service
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:10
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 10
V/Monotype: SetAppTypeFace- try to flip, app = com.example.stitaft.datarial
V/Monotype:     Typeface getFontPathFlipFont - systemFont = /data/data/flipfont/app_fonts/Syndor#Syndor
V/FA: Using measurement service
V/FA: Connection attempt already in progress
W/art: Suspending all threads took: 18.543ms
I/art: Background partial concurrent mark sweep GC freed 5301(442KB) AllocSpace objects, 9(144KB) LOS objects, 40% free, 4MB/7MB, paused 21.963ms total 135.355ms
I/art: DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/x86/data@data@com.google.android.gms@app_chimera@m@0000003c@DynamiteModulesC_GmsCore_prodlmp_alldpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/0000003c/DynamiteModulesC_GmsCore_prodlmp_alldpi_release.apk': Failed to open oat filename for reading: No such file or directory
D/AndroidRuntime: Shutting down VM
E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.stitaft.datarial/com.example.stitaft.datarial.MainActivity}: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378)
                         at android.app.ActivityThread.access$800(ActivityThread.java:147)
                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
                         at android.os.Handler.dispatchMessage(Handler.java:102)
                         at android.os.Looper.loop(Looper.java:135)
                         at android.app.ActivityThread.main(ActivityThread.java:5255)
                         at java.lang.reflect.Method.invoke(Native Method)
                         at java.lang.reflect.Method.invoke(Method.java:372)
                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
                      Caused by: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
                         at android.app.ActivityManager$TaskDescription.<init>(ActivityManager.java:538)
                         at android.app.Activity.onApplyThemeResource(Activity.java:3719)
                         at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:140)
                         at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:85)
                         at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:89)
                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378) 
                         at android.app.ActivityThread.access$800(ActivityThread.java:147) 
                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) 
                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                         at android.os.Looper.loop(Looper.java:135) 
                         at android.app.ActivityThread.main(ActivityThread.java:5255) 
                         at java.lang.reflect.Method.invoke(Native Method) 
                         at java.lang.reflect.Method.invoke(Method.java:372) 
                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838) 
                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651) 
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader ae[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/0000003c/DynamiteModulesC_GmsCore_prodlmp_alldpi_release.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
I/FirebaseCrash: FirebaseCrash reporting loaded - com.google.android.gms.internal.ml@1b3c2d41
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/FirebaseCrashApiImpl: FirebaseCrash reporting API initialized
E/UncaughtException: Ouch! My own exception handler threw an exception.
                     java.util.concurrent.TimeoutException
                         at java.util.concurrent.FutureTask.get(FutureTask.java:176)
                         at com.google.firebase.crash.FirebaseCrash$zzc.uncaughtException(Unknown Source)
                         at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
                         at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.example.stitaft.datarial, PID: 8210
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.stitaft.datarial/com.example.stitaft.datarial.MainActivity}: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378)
                      at android.app.ActivityThread.access$800(ActivityThread.java:147)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:135)
                      at android.app.ActivityThread.main(ActivityThread.java:5255)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:372)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
                   Caused by: java.lang.RuntimeException: A TaskDescription's primary color should be opaque
                      at android.app.ActivityManager$TaskDescription.<init>(ActivityManager.java:538)
                      at android.app.Activity.onApplyThemeResource(Activity.java:3719)
                      at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:140)
                      at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:85)
                      at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:89)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378) 
                      at android.app.ActivityThread.access$800(ActivityThread.java:147) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:135) 
                      at android.app.ActivityThread.main(ActivityThread.java:5255) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at java.lang.reflect.Method.invoke(Method.java:372) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651) 
I/Process: Sending signal. PID: 8210 SIG: 9
Application terminated.

0 个答案:

没有答案