Zain Toor

Greenhorn
+ Follow
since Mar 17, 2022
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zain Toor

I'm gonna be completely honest, I have no idea what this error is and what it means, all I know is that my app is not working properly because of it and idk how to fix it. It only shows up in the logcat after I try and run the app, and its not anywhere in any of my activities.


2023-06-18 09:04:35.739  3162-3823  m.lge.launcher          com.lge.launcher3                    E  Failed to open APK '/data/app/com.example.justbu-OestZAuAFm-UlVFrEDBCqA==/base.apk' I/O error
2023-06-18 09:04:35.742  3162-3823  ResourcesManager        com.lge.launcher3                    E  failed to add asset path /data/app/com.example.justbu-OestZAuAFm-UlVFrEDBCqA==/base.apk
2023-06-18 09:24:10.779 17046-29454 Finsky                  com.android.vending                  E  [42625] VerifyV31SignatureInstallTask.d(2): VerifyApps V31SignatureVerification: Successful verification for the package: com.example.justbu using APK Signature Scheme v3
2023-06-18 09:24:42.336  3162-3823  m.lge.launcher          com.lge.launcher3                    E  Failed to open APK '/data/app/com.example.justbu-Vt3WTCyIJEbXcnWsVwZr3w==/base.apk' I/O error
2023-06-18 09:24:42.338  3162-3823  ResourcesManager        com.lge.launcher3                    E  failed to add asset path /data/app/com.example.justbu-Vt3WTCyIJEbXcnWsVwZr3w==/base.apk

11 months ago
I am making an app that uses firebase, in which you register using email and password, the app then gives you a 4 digit randomly generated PIN, you can then use that PIN to find a user with the corresponding PIN and start a chat with them. However my code doesn't seem to be working right now. I used sample data and it worked fine but if I try to enter the PIN of another user (I created 2 accounts so 2 PINs) the chat doesn't display, rather I get a blank screen where the chat should be displayed in a recyclerView.

Here is my code.




11 months ago
I am coding an app in which the user can enter the PIN of another user and start a chat with them;

My Handler.java class and looper.java class are now riddled with errors, this is  the main one that I am seeing;
'android.annotation.NonNull' is not public in 'android.annotation'. Cannot be accessed from outside package

I will attach the log for the latest run of the app I did if that helps solve the issue;

 E  FATAL EXCEPTION: main
                                                                                                   Process: com.example.justbu, PID: 28899
                                                                                                   java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.justbu/com.example.justbu.Chat}: java.lang.ClassCastException: com.example.justbu.Chat cannot be cast to android.app.Activity
                                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3247)
                                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3462)
                                                                                                    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
                                                                                                    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                                                                                                    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)
                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:107)
                                                                                                    at android.os.Looper.loop(Looper.java:214)
                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7615)
                                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
                                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
                                                                                                   Caused by: java.lang.ClassCastException: com.example.justbu.Chat cannot be cast to android.app.Activity
                                                                                                    at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
                                                                                                    at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
                                                                                                    at android.app.Instrumentation.newActivity(Instrumentation.java:1251)
                                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235)
                                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3462) 
                                                                                                    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
                                                                                                    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
                                                                                                    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
                                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063) 
                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:107) 
                                                                                                    at android.os.Looper.loop(Looper.java:214) 
                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7615) 
                                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
                                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) 
11 months ago
I am creating an app in which the user registers with his email and password, then the app will give the user a 4 digit PIN. The registration works in the sense that the email and password gets saved, but the 4 digit PIN isn't being generated and the registration button doesn't take me to the next activity, however if I type in the email and password in the login activity I can get to the next screen. This is my registration activity code, after the registration button is clicked.



1 year ago
My app build says successful but I keep seeing this message, how do I fix it. Here is my build.gradle;

buildscript {
   repositories {
       google()  // Google's Maven repository
       mavenCentral()  // Maven Central repository
   }
   dependencies {
       classpath 'com.android.tools.build:gradle:8.0.2'
       classpath 'com.google.gms:google-services:4.3.15'
   }
}

plugins {
   id 'com.android.application' version '8.0.2' apply false
   id 'com.android.library' version '8.0.2' apply false
}

allprojects {
   repositories {
       google()  // Google's Maven repository
       mavenCentral()  // Maven Central repository
       maven {
           url 'https://maven.google.com/'
           name 'Google'
       }
       // ... any additional repositories you might need
   }
}
1 year ago

Campbell Ritchie wrote:You need to check programmatically which is null.



Ok I ran it and the issue is with the getText
2 years ago

Campbell Ritchie wrote:So which is null? V1 or V1.getText()?



I believe it is appearing in the V1.getText(). I apologize if that is incorrect.
2 years ago
Oh, sorry my bad. It is this line that is giving me the error.
2 years ago
This is the full error I am receiving "Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference", in terms of other errors all of that is fine.
2 years ago
So I am coding a physics based app in android studios and I keep getting this error,  "Attempt to invoke virtual method ""  on a null object reference" This is the code I have made for it.



I have no idea why I am getting this issue because it is working in my other classes perfectly fine.
2 years ago
Thanks but I figured it out on my own, it was a stupid mistake
2 years ago
Oh yeah, so I have all the code for everything else, and it works great, and the double arrays are set up like this

(0,0)(0,1)(0,2)(0,3)(0,4)
(1,0)(1,1)(1,2)(1,3)(1,3)
(2,0)(2,1)(2,2)(2,3)(2,4)
(3,0)(3,1)(3,2)(3,3)(3,4)
(4,0)(4,1)(4,2)(4,3)(4,4)
2 years ago
I made a 5 x 5 tic tac toe but I can't seem to figure out how to make the bottom right - top left diagonal work. I've figured everything else out but that bit is giving me trouble, here is the code


The second line is for the bottom right-top left diagonal.
2 years ago
Should I add the zip file or will a screenshot work, also the game works perfectly fine, its just the images not loading
2 years ago