Java 安卓应用程序在几秒钟后中断。工作

Java 安卓应用程序在几秒钟后中断。工作,java,android,linux,ubuntu,android-emulator,Java,Android,Linux,Ubuntu,Android Emulator,Nexus4API22 我在用Ubuntu。Android Studio 3.0。 我在标准仿真器上运行应用程序,并得到此错误 08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: VM with version 2.1.0 has multidex support 08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: Insta

Nexus4API22

我在用Ubuntu。Android Studio 3.0。
我在标准仿真器上运行应用程序,并得到此错误

    08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: VM with version 2.1.0 has multidex support
08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: Installing application
08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-29 14:21:04.058 5343-5343/com.knowledgecity.us_site I/InstantRun: starting instant run server: is main process
08-29 14:21:04.067 5343-5343/com.knowledgecity.us_site I/MultiDex: Installing application
08-29 14:21:04.067 5343-5343/com.knowledgecity.us_site I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-29 14:21:04.361 5343-5343/com.knowledgecity.us_site W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-29 14:21:04.420 5343-5355/com.knowledgecity.us_site I/art: Background sticky concurrent mark sweep GC freed 4119(386KB) AllocSpace objects, 4(64KB) LOS objects, 1% free, 2MB/2MB, paused 747us total 101.676ms
08-29 14:21:04.567 5343-5355/com.knowledgecity.us_site W/art: Suspending all threads took: 10.350ms
08-29 14:21:04.568 5343-5355/com.knowledgecity.us_site I/art: Background sticky concurrent mark sweep GC freed 71(34KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 3MB/3MB, paused 10.906ms total 39.420ms
08-29 14:21:04.583 5343-5343/com.knowledgecity.us_site I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
08-29 14:21:04.708 5343-5355/com.knowledgecity.us_site W/art: Suspending all threads took: 8.592ms
08-29 14:21:04.709 5343-5355/com.knowledgecity.us_site I/art: Background partial concurrent mark sweep GC freed 238(16KB) AllocSpace objects, 0(0B) LOS objects, 36% free, 6MB/10MB, paused 9.362ms total 21.672ms
08-29 14:21:04.760 5343-5404/com.knowledgecity.us_site D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                                                                         [ 08-29 14:21:04.761  5343: 5343 D/         ]
                                                                         HostConnection::get() New Host Connection established 0xa3c490b0, tid 5343


                                                                         [ 08-29 14:21:04.763  5343: 5343 W/         ]
                                                                         Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 
08-29 14:21:04.764 5343-5343/com.knowledgecity.us_site D/Atlas: Validating map...
08-29 14:21:04.793 5343-5404/com.knowledgecity.us_site I/OpenGLRenderer: Initialized EGL, version 1.4
08-29 14:21:04.793 5343-5404/com.knowledgecity.us_site W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-29 14:21:04.799 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglCreateContext: 0xa3c21700: maj 2 min 0 rcv 2
08-29 14:21:04.945 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglMakeCurrent: 0xa3c21700: ver 2 0
08-29 14:21:04.957 5343-5404/com.knowledgecity.us_site D/OpenGLRenderer: Enabling debug mode 0
08-29 14:21:05.067 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglMakeCurrent: 0xa3c21700: ver 2 0
08-29 14:21:05.128 5343-5343/com.knowledgecity.us_site W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
08-29 14:21:05.192 5343-5380/com.knowledgecity.us_site A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xb72085ce in tid 5380 (Queue)
我在Genimotion上也试过同样的方法。安卓4和5.06.0。一切都一样

但是如果你在一部真正的手机上做同样的事情。顺便说一下,我有安卓6.0。一切正常。在其他手机上也进行了检查

Ie的模拟器或Ubuntu出现了一些错误

如何纠正此错误

先谢谢你


顺便说一下,我注意到了这样一件事。如果我在模拟器上禁用Internet,那么应用程序将启动。但是如果我打开互联网登录,我会得到一个错误

Ie应用程序试图通过仿真器使用Internet,此时我遇到一个错误


谁面临这个问题?)

只需启用多索引:按照以下步骤操作

android {    
defaultConfig {
    // Enabling multidex support.
    multiDexEnabled true
}  
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
public class Multi_Dex extends Application {
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
}
<application
    android:name=".Multi_Dex"
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
创建一个这样的类

android {    
defaultConfig {
    // Enabling multidex support.
    multiDexEnabled true
}  
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
public class Multi_Dex extends Application {
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
}
<application
    android:name=".Multi_Dex"
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
现在在您的manifiest文件中添加此项

android {    
defaultConfig {
    // Enabling multidex support.
    multiDexEnabled true
}  
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
public class Multi_Dex extends Application {
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
}
<application
    android:name=".Multi_Dex"
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

在渐变中添加以下代码:

defaultConfig {
    multiDexEnabled true
}
dependencies {
    compile 'com.android.support:multidex:1.0.1'
}
创建一个类,我们将其命名为
App
,并从
MultiDexApplication
扩展如下:

import android.support.multidex.MultiDexApplication;

public class App extends MultiDexApplication {
    //you can leave this empty or override methods if you like so the thing is that you need to extend from MultiDexApplication

}
在清单中添加
App
作为应用程序名称,如下所示

<application
        android:name=".App" // <-- this is the important line!
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name">
你不会相信我的)。但我已经登记好了