0

I've just migrated my app to androidX and it keeps crushing. Please help me, I'm going mad. Thanks. this is my build.gradle:

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.grany.sprint"
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

Also this is my gradle.properties :

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true

my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.grany.sprint"
    >

    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <queries>
        <package android:name="com.whatsapp" />
        <package android:name="org.telegram.messenger" />
    </queries>

    <application
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:allowBackup="true"
        android:icon="@drawable/granny_phone"
        android:label="@string/app_name"
        android:roundIcon="@drawable/granny_phone"
        android:supportsRtl="true"
        android:theme="@style/Theme.GranySprint"
        tools:replace="android:appComponentFactory">
        <activity android:name=".settings"/>
        <activity android:name=".web" />
        <activity android:name=".camera" />
        <activity android:name=".message" />
        <activity android:name=".phone" />
        <activity android:name=".MainActivity"
            android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name=".WidgetProvider">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
            </intent-filter>
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget_info"/>
        </receiver>
    </application>

</manifest>

P.S: I've also replaced

import android.support.v7.app.AppCompatActivity;

with

import androidx.appcompat.app.AppCompatActivity;

And

<android.support.constraint.ConstraintLayout>

With

<androidx.constraintlayout.widget.ConstraintLayout>

In all java and xml files. If you need other files please ask. Thanks again. Leo

0 Answers0