XmlResourcesTransformer No mapping for package 'android.support.v7.internal.widget' in 'com\android\support\migrateToAndroidx\migration.xml'

Viewed 11

[XmlResourceTransformer]Facing a lot of problem that no mapping package in MigrateToAndroidX

[XmlResourceTransformer]Facing a lot of problem that no mapping package in MigrateToAndroidX

  1. build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdk 33

    defaultConfig {
        applicationId "com.example.UTAR_LBSNS"
        minSdkVersion 24
        targetSdkVersion 33
        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.5.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    implementation 'com.android.tools.build:gradle:7.1.0'
    implementation 'com.google.android.material:material:1.8.0-alpha01'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.browser:browser:1.4.0'
    implementation 'com.google.gms:google-services:4.3.13'
    implementation 'com.google.android.gms:play-services-auth:20.3.0'
    implementation 'com.google.firebase:firebase-messaging:23.0.8'
    implementation 'com.google.firebase:firebase-core:21.1.1'
    implementation 'com.google.firebase:firebase-database:20.0.6'
    implementation 'com.google.firebase:firebase-auth:21.0.8'
    implementation 'com.google.firebase:firebase-storage:20.0.2'
    implementation 'com.mikhaellopez:circularimageview:4.3.1'
    implementation 'androidx.activity:activity:1.6.0-rc02'
    implementation 'androidx.activity:activity-ktx:1.6.0-rc02'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.fragment:fragment:1.6.0-alpha02'
    implementation 'androidx.fragment:fragment-ktx:1.6.0-alpha02'
    implementation 'com.android.tools.build:gradle:7.2.2'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.gcacace:signature-pad:1.3.1'
    implementation "androidx.activity:activity-ktx:1.6.0-rc02"
    implementation 'androidx.activity:activity:1.6.0-rc02@aar'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation files('libs/activation.jar')
    implementation files('libs/additional.jar')
    implementation files('libs/mail.jar')
    implementation 'com.jakewharton:butterknife:10.2.3'
    implementation platform('com.google.firebase:firebase-bom:30.4.1')
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    testImplementation 'junit:junit:4.13.2'
    implementation 'com.github.gcacace:signature-pad:1.3.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

2.This is the settings.gradle

import org.gradle.api.initialization.resolve.RepositoriesMode
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}
rootProject.name = "UTAR_LBSNS"
include ':app'

3.this is the main activities

package com.example.UTAR_LBSNS.Activities;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.example.UTAR_LBSNS.R;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener{

    // Declare variables

    private FirebaseAuth firebaseAuth;

    private TextView textViewSignup, textViewResetPassword;
    private EditText editTextEmail, editTextPassword;
    private Button buttonSignin;

    private ProgressBar progressBar;

    private Context context = this;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);
        setContentView(R.layout.activity_login);

        firebaseAuth = FirebaseAuth.getInstance();

        progressBar.setVisibility(View.INVISIBLE);

        this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

        textViewSignup = (TextView) findViewById(R.id.textViewSignup);
        textViewResetPassword = (TextView) findViewById(R.id.textViewResetPassword);
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        buttonSignin = (Button) findViewById(R.id.buttonSignin);

        progressBar = new ProgressBar(this);

        // Set Listeners
        textViewSignup.setOnClickListener(this);
        textViewResetPassword.setOnClickListener(this);
        buttonSignin.setOnClickListener(this);
    }

    private void userLogin(){
        String email = editTextEmail.getText().toString().trim();
        String password  = editTextPassword.getText().toString().trim();

        // If email is empty, return
        if (TextUtils.isEmpty(email)){
            Toast.makeText(this,"Please enter email",Toast.LENGTH_LONG).show();
            return;
        }

        // If email is empty, return
        if (TextUtils.isEmpty(password)){
            Toast.makeText(this,"Please enter password",Toast.LENGTH_LONG).show();
            return;
        }

        progressBar.setVisibility(View.VISIBLE);

        // Sign in with email and password
        firebaseAuth.signInWithEmailAndPassword(email, password)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    progressBar.setVisibility(View.GONE);
                    if (task.isSuccessful()){
                        // If email is not verified, verify
                        FirebaseUser user = firebaseAuth.getCurrentUser();
                        if (!user.isEmailVerified()){
                            Toast.makeText(LoginActivity.this, "Please Verify email.",Toast.LENGTH_SHORT).show();
                        }
                        else{
                            // start main activity
                            finish();
                            startActivity(new Intent(getApplicationContext(), MainActivity.class));
                        }
                    }
                    else {
                        // Failed to log in
                        Toast.makeText(LoginActivity.this, "Authentication failed.",Toast.LENGTH_SHORT).show();
                    }
                }
            });
    }

    @Override
    public void onClick(View view){
        if (view == buttonSignin){
            userLogin();
        }
        else if (view == textViewSignup){
            finish();
            startActivity(new Intent(this, RegisterActivity.class ));
        }
        else if (view == textViewResetPassword){
            // Reset password through email
            firebaseAuth.getInstance().sendPasswordResetEmail("leepeterwy@gmail.com")
                .addOnCompleteListener(new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        if (task.isSuccessful()) {
                            Toast.makeText(context, "Email Sent", Toast.LENGTH_LONG).show();
                        }
                    }
                });
        }
    }
}

Please help me to solve this, i spend three days but cant find a proper solution on that, thanks in advance.

0 Answers
Related