Android Question class file for android.support.v4.app.NotificationCompat not found

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I updated to AndroidX SDK and found I can't seem to compile my app.

I am using the NotificationBuilder6.

I have TargetSDKVersion 28 in the Manifest.

I have updated all SDK the latest from Tools > SDK Manger.

When I go to Tools > Jetifier (AndroidX) it comes up saying 'All set. Nothing to do!'
It lets me press the refresh button but it looks like it's doing nothing. The Jetify button doesn't seem to work or is disabled. (I click on it and it does nothing, don't even see the button press happen)

When I compile my app I get the following error:

B4A Version: 9.50
Java Version: 8
Parsing code. (0.22s)
Building folders structure. (0.02s)
Compiling code. (1.19s)
Compiling layouts code. (0.13s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (3.52s)
Compiling generated Java code. Error
B4A line: 2724
Dim jo As JavaObject = nb
javac 1.8.0_60
src\com\myapp\app\namehere.java:5292: error: cannot access NotificationCompat
_jo.setObject((java.lang.Object)(_nb.getObject()));
^
class file for android.support.v4.app.NotificationCompat not found

Before updating to AndroidX SDK it all was working fine.

Any ideas on what I have done wrong ?
 

DonManfred

Expert
Licensed User
Longtime User
are you using the class or a compiled class?

Try adding a
B4X:
#additionajar: androidx.core.app.NotificationCompat
and check the NB6 class for any imports and adapt them.

Check the files androidx-artifact-mapping.csv and androidx-class-mapping.csv in the b4a installationdir.

Edit to add: i dont see any problematic import (inlinejava) there. So this is probably not the case here.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
are you using the class or a compiled class?
Using the class.

Try adding
Tried that but it shows:
B4A Version: 9.50
Java Version: 8
Parsing code. (0.24s)
Building folders structure. (0.03s)
Compiling code. (1.48s)
Compiling layouts code. (0.21s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (0.02s)
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\androidx.core.app.notificationcompat.jar

I guess it's missing a file? (I can't seem to find that jar file anywhere)


When I run the command in command prompt, it just opens the Jetifier window (version 1.01) and the command prompt doesn't shows any errors.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I´ll try to build my app which is using the class too later today. I´ll repond here if i get the same issue and maybe found an solution. I guess one need to adapt the javaobject calls in there to match the corresponding classes in the AndroidX artifacts.
 
Upvote 0
Top