• 6
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Errors due to androidx drawerlayout

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cn/com.example.cn.MainActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.v4.widget.DrawerLayout

<?xml version="1.0" encoding="utf-8"?>  
<androidx.drawerlayout.widget.DrawerLayout  
xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:app="http://schemas.android.com/apk/res-auto"  
xmlns:tools="http://schemas.android.com/tools"  
android:id="@+id/drawable_layout"  
android:layout_width="match_parent"  
android:layout_height="match_parent"  
android:paddingLeft="10dp"  
android:paddingBottom="5dp"  
tools:context="com.example.cn.MainActivity"  
android:paddingStart="10dp"  
tools:ignore="RtlSymmetry">  

app

'''

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

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.cn"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])  
//noinspection GradleCompatible  
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'  
implementation 'com.google.android.material:material:1.1.0-alpha04'  
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'  
implementation 'de.hdodenhof:circleimageview:3.0.0'  
implementation 'com.google.firebase:firebase-core:16.0.7'  
implementation 'com.google.firebase:firebase-auth:16.1.0'  
implementation 'com.google.firebase:firebase-messaging:17.4.0'  
apply plugin: 'com.google.gms.google-services'  
implementation 'com.firebaseui:firebase-ui-database:4.3.1'  
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'  
implementation 'com.squareup.picasso:picasso:2.71828'  
implementation 'com.google.firebase:firebase-database:16.1.0'  
implementation 'com.google.firebase:firebase-storage:16.1.0'  
testImplementation 'junit:junit:4.12'  
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'  
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-   
alpha01'  
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha02'    
}  

'''

Error is obvious. You are using Android Support Libraries in dependencies but in layout you are trying to use androidx.

For example:

Android Support Libray: com.android.support:appcompat-v7

AndroidX: androidx.appcompat:appcompat:1.0.0

So you have one of the two options either continue using Android Support Libraries which means you need to rename DrawerLayout to <android.support.v4.widget.DrawerLayout or to upgrade project to AndroidX.

To make upgrade you can do that from Android Studio by going on Refactor -> Migrate to AndroidX.

If you decide to use this way, follow suggestions provided by Android Studio it will zip your project and than make upgrade. That means you can always return to your project before AndroidX upgrade.

Also there is possibility that not all things will work after upgrade and maybe manually adjustment will be needed.

Or manually: https://developer.android.com/jetpack/androidx/migrate

  • 1
Reply Report

Check if you have added the dependency.

dependencies {
   implementation 'com.android.support:appcompat-v7:28.0.0'
   implementation 'com.android.support:design:28.0.0'
}

Then use the tag android.support.v4.widget.DrawerLayout.

  • 0
Reply Report
      • 1
    • if you use com.android.support then you should not be using androidx.drawerlayout.widget.DrawerLayout since that's the DrawerLayout from AndroidX. Note: the support library is outdated. Many libraries are moving away from it as well. Use AndroidX