2017-08-29 123 views
-1

Nexus 4 API 22.Android。几秒钟后应用程序将中断。工作

我正在使用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同样的事情。 Android 4和5.0 6.0。一切都是一样的。

但是,如果你在真正的手机上做同样的事情。顺便说一句,我有Android 6.0。这一切都很好。在其他手机上也检查过。

即事实证明,模拟器或Ubuntu有一些错误。

可以做些什么来纠正这个错误?

预先感谢您


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

即应用程序试图通过模拟器使用互联网,我现在得到一个错误。

谁遇到这一点)))

+0

检查此https://stackoverflow.com/questions/44603154/how-to-fix-android-4-4-2-error-classnotfoundexception-didnt-find-class-com-go/44603205#44603205 –

回答

2

添加下面的代码在你的gradle产出:

defaultConfig { 
    multiDexEnabled true 
} 
dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
} 

创建一个类,让我们将其命名为AppMultiDexApplication扩展这样的:

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"> 

添加所有内容后,请进行清洁构建,现在应该可以工作:)。

+0

你不会相信我)。但一切已经注册我 – Prost

+1

仍然收到错误? –

+0

'是的。我更新了这个问题。请看这里 – Prost

3

只是使multidex:请按照下列步骤

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); 
} 
} 

现在在manifiest文件加这个

<application 
    android:name=".Multi_Dex" 
    android:allowBackup="true" 
    android:icon="@drawable/logo" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
相关问题