1

I'm trying to run my app in GenyMotion, but I get the following error:

FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.voopter/com.myapp.splash.Splash}: android.view.InflateException: Binary XML file line #14: Error inflating class com.myapp.widgets.DosisRegularTextView at android.app.ActivityThread.performLaunchActivity

My XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:background="@drawable/bg_splash" />

    <com.myapp.widgets.DosisRegularTextView
        android:id="@+id/dosisBoldTextView1"
        android:textSize="20sp"
        android:textColor="#5C5C5C"
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:text="@string/splash" />

    <com.myapp.widgets.DosisRegularTextView
        android:id="@+id/DosisRegularTextView01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="15dp"
        android:text="@string/splash_versao"
        android:textColor="#5C5C5C"
        android:textSize="14sp" />

</RelativeLayout>

If I simply comment out the DosisRegularTextView in my xml, the error shifts to for other place. If I comment that out, it shifts to another, and so on... It never ends. Can be in class, xml, Handler, etc.

My DosisRegularTextView:

    public class DosisRegularTextView extends TextView {

    public DosisRegularTextView(Context context) {
        super(context);
        if (!isInEditMode())
            setFont();
    }

    public DosisRegularTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        if (!isInEditMode())
            setFont();
    }

    public DosisRegularTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        if (!isInEditMode())
            setFont();
    }

    private void setFont() {
        if (!isInEditMode())
            setTypeface(Applic.typefaceDosisRegular);
    }
}

My Android Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myapp"
    android:versionCode="2"
    android:versionName="2.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permissions.READ_DATABASE" />
    <uses-permission android:name="android.permissioms.WRITE_DATABASE" />
    <uses-permission android:name="android.permission.STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.SET_DEBUG_APP" />

    <!-- PARSE -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false"  />
    <uses-feature
        android:name="android.hardware.location"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" />

    <permission
        android:name="com.myapp.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.myapp.permission.C2D_MESSAGE" />

    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- PARSE -->
    <application
        android:name=".Applic"
        android:allowBackup="true"
        android:icon="@drawable/ico_app"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <!-- <meta-data android:name="com.google.android.gms.version" android:value="7571000" /> -->

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="11111" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <!--<meta-data-->
            <!--android:name="com.facebook.sdk.ApplicationId"-->
            <!--android:value="@string/app_id" />-->
        <!--<meta-data-->
            <!--android:name="com.google.android.maps.v2.API_KEY"-->
            <!--android:value="xxxx" />-->

        <activity android:name="com.facebook.FacebookActivity"
            android:configChanges=
                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:label="@string/app_name" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationName"
            android:value="@string/facebook_app_name" />


        <!--    Chave facebook homologacao   - -->
        <!--<provider-->
            <!--android:name="com.facebook.FacebookContentProvider"-->
            <!--android:authorities="com.facebook.app.FacebookContentProvider1111111111"-->
            <!--android:exported="true" />-->


        <!--    Chave facebook producao   - -->
        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider11111111"
            android:exported="true" />

        <receiver android:name=".login.enter.social.MyFacebookBroadcastReceiver" >
            <intent-filter>
                <action android:name="com.facebook.platform.AppCallResultBroadcast" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".Home"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".buscar.calendar.CalendarHost"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>

        <activity
            android:name=".splash.Splash"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".login.Login"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>

        <!-- PARSE -->
        <service android:name="com.parse.PushService" />

        <receiver
            android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <!-- IMPORTANT: Change "com.parse.starter" to match your app's package name. -->
                <category android:name="com.myapp" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

The strangest part is that it runs fine in Android Studio Emulator and ARC Welder. It only crashes on GenyMotion (even using an apk installation).

Tried to update Google Play service and getting login, but doesn't work.

What's happening here?

Cœur
  • 37,241
  • 25
  • 195
  • 267
elisonj
  • 11
  • 3
  • Are you sure that your custom view lives in the `com.myapp.widgets.DosisRegularTextView` package? – akodiakson Sep 22 '15 at 19:52
  • @akodiakson Yeah! A can access the class throught the xml.... If I remove the view I started to have this error: FATAL EXCEPTION: main java.lang.VerifyError: com/voopter/core/util/TrackerUtil at com.myapp.splash.Splash.onCreate(Splash.java:59) If I remove the line 59: // Applic.mapYml = TrackerUtil.loadYml(this); I got another: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.myapp.splash.SplashController$1 at com.myapp.splash.SplashController.init(SplashController.java:119) at com.myapp.splash.Splash.onResume(Splash.java:74) – elisonj Sep 23 '15 at 14:12

0 Answers0