Android Question Notification Builder Problem, the 17th

Creideiki

Active Member
Licensed User
Longtime User
I have the same Notification Builder problem like many others, but I haven't found the solution for me. I get the error
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/NotificationCompat$Builder;
  at barxdroid.NotificationBuilder.NotificationBuilder.Initialize(NotificationBuilder.java:55)

I know that I miss android-support-v4.jar. Or better I miss the correct version. I tried
- install a fresh Android studio and take the one from there to the additional library directory -> same error
- I added android-support-v13.jar -> same error
- I tried to get a new version with the sdk manager from android studio
That failed, too. The android support was marked as 'installed'. To force a reload I deleted it and wanted to install it again. That failed, because the sdk manager killed it completely; I don't find the entry 'android support' anymore, so I can't re-install it.

Now I'm at my wit's end. Where can I get this file from, if the sdk manager doesn't offer it? How can I decide if I have the right version - say: what is the right version for the Notification Builder?

There is the directory m2repository/com/android/support/support-v4 with many directories and many files support-v4-xxx. But are these the same? And if yes, which one?
 

Creideiki

Active Member
Licensed User
Longtime User
Sorry... I forgot to mention I added the #additionaljar.

When I search the google page it is quite difficult zu find something without using studio... I downloaded and installed an sdk-installer, but it installed the same sdk manger I got with the studio installation.

It seems the old extras/support directory is gone. It seems to be replaced by the m2repository/com/android/support/support-v4 directory. But there is not one android-support-v4.jar, but a bunch of support-v4-xxx.jar and since 20.0.0 support-v4-xxx.aar.

No android-support-v4.jar any more.
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
OK. No android-support-v4.jar in the additional library directory, right?

Then I get
B4X:
Compiling generated Java code.  Error
Cannot find: E:\Programme\Anywhere Software\Basic4android\libraries\android-support-v4.jar
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
Hmmm...
B4X:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
Does that matter?
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/NotificationCompat$Builder;
  at barxdroid.NotificationBuilder.NotificationBuilder.Initialize(NotificationBuilder.java:55)
[...]
nb.Initialize is enough to crash the app...
 
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
I use B4A 6.50.

I attached the project I work on; I tried to simplify it a bit, but that's quite difficult, since the main purpose is to be a widget.
The WidgetService is the main part. There I declare and initialize the notification builder. The usage isn't active, since it crashes at initializing already.
I hope someone can find out why...
 

Attachments

  • NBProblem.zip
    57.1 KB · Views: 242
Upvote 0

Creideiki

Active Member
Licensed User
Longtime User
OK. I knew it was something mini... One should read the docs exactly...

Thanks to all for your patience.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…