I know, usually you would tell me to check the logs (before the crash, and see if I missed something) . . Nothing, because the app crashes no matter what, when I try to start a new activity. The only two activities that works are SplashScreen
and SignIn
For the sake of trying to find out the problem to this, I did something simple
public class SplashScreen extends AppCompatActivity{
private final static String TAG = SplashScreen.class.getSimpleName();
private final static int DELAY = 2000;
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
startActivity(new Intent(this, Root.class));
finish();
}
and Root.class
public class Root extends AppCompatActivity {
private final static String TAG = Root.class.getSimpleName();
private long backPressedTime = 0;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
Log.i(TAG, "super.onCreate");
setContentView(R.layout.trending);
Log.i(TAG, "setContentView");
}
So I set up some logs and looks like I goes to the second log.. 3rd one setcontentView
is not displayed in console. The problem is even more weird, because no matter what class I try to start, it happens the same.
Mentions:
checked logs, nothing there with an exception (a warning
03-13 13:52:33.302 23233-23233/com.example.codkom.shirtex W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable ...
worked on the app a couple of days and tested on my personal device (working without problems, even now it does) but not on any other devices..
if does count, I use multidex, I override my
Application
class and didMultidex.install(context);
as per documentation (said this because I had a guess that might be cause by Multidex but tested on API 21+ without multidex and it was ok(since API 21+ handle multidex on it's own)I have 7 activities in my project, problem occurs on 3 of them
I got to a point where I have no idea what else to do.. so that's why I came here with this question.
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cl_"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.design.widget.AppBarLayout
android:background="@drawable/overlay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
app:layout_scrollFlags="enterAlways|scroll"
app:navigationIcon="@drawable/ic_hamburger_menu">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_15_dp"
android:id="@+id/fab_"
android:backgroundTint="@color/blue"
app:fabSize="normal"
android:src="@drawable/ic_plus"
app:layout_anchor="@id/content_frame"
app:layout_anchorGravity="center|bottom"
app:layout_behavior="com.example.codkom.shirtex.ScrollAwareFABBehavior"/>
</android.support.design.widget.CoordinatorLayout>
<!-- The navigation drawer -->
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start">
<include layout="@layout/mainmenu_activity"/>
</android.support.design.widget.NavigationView>
In Manifest
<application
android:name=".application.ShirTexApp"
android:allowBackup="true"
android:icon="@drawable/ic_app_logo"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat"
android:fullBackupContent="true">
<activity android:name=".activities.Root" android:theme="@style/Theme.AppCompat.Light.NoActionBar" android:windowSoftInputMode="adjustPan"/>
</application>