ScanView error. Runtime Error Failed resolution of: Lcom/google/zxing/BarcodeFormat

Hello guys, until this morning the scanview extension worked well, I designed several apps using it and I did not have any problem. But since this morning the APK of my app has this problem. I made some test designing a minimum app using blocks of code I know working without solvin it. It works using companion but it stops suddendly with the APK. I attached my test program.
TestScanView.aia (53.8 KB)

It is strange because I tried to rebuild old apps developed scanview and from which I copied the blocks I am using in the new app. The old app builds and the APK runs without any error. The test program I attached in the original post does not use any extension but does not work so I believe the problem is not related to other extensions. And I checked the release of scanview, it is always the newest:
ScanView 2.2, is an extension to scan barcodes based on Zxing (Zebra Crossing) Library for Android.

Silver 2020 I used code from: GitHub - dm77/barcodescanner: Barcode Scanner Libraries for Android
Extension Version: 2
Date Built: 2021-12-14

1 Like

I presume you are referring to the ScanView extension ? Or something else ?

Please provide links to help others help you, and be more specific with regard to your issues.

Yes, I found an help on the Koular forum, just placing a BarcodeScanner in Screen1 and the error is gone, but I do not understand why. I have other apps working without this trick and why the test app I attached obtained by one app that works fine does not work. At the moment it is a solution but I do not like to do not understand why happened today.

Your aia is built with ai2offline, this is the AppInventor community

It is tested with both, same source, same behaviour, apart a couple of blocks I did not note that are present in AI2 and another couple only in AI2Oflline I write apps compatible with both, it is a must here.

What distribution are you using? Either you use AppInventor online and get help here... or you use the offline version or kodular, then look elsewhere for help... we don't want to read about some offline distros here... it's not our brooch...

For what it is worth, using AppInventor (AI2), I just compiled an apk with ScanView.v2.2, and it works without any error, scanning a barcode and a qrcode. (note: With AI2 barcodescanner component loaded - externalScanner unticked, and required camera permission)

I use AI2 online and AI2Offline, our apps have to work with both. I do not use Kodular but googling for the problem, as often the extension was designed to work in AI2 and in Kodular so I have an account in Kodular to have more possibility to find help for these extensions. About AI2Offline it is mainly a self contained port of AI2, in the past there were some discussion here how to install in a local server a copy of AI2. The reason is simple, we develop also professional apps that need to be mintained for several years and we can not risk they can not build because AI2 updates. Instead, working also in AI2Oflline give us the posibility to backup everything, the aia, the extensions and the AI2Offline version used to build the app.

But, based upon your last few topics, this does not appear to be working....

No, in this case I do not why, but the suggestion/solution found in an old post in Kodular forum solved the problem and it solve for AI2 and AI2Offline, I suppose it worked also in Kodular but I do not use it.
In general there are minimum differences in the interface of AI2 and AI2Offline, mainly in the Designer for Screen1 and lastly I discovered there are a couple of blocks in AI2Offline that are not in AI2 and viceversa one block in AI2 not present in AI2Offline. But for all these blocks there are replacements in some extensions so now we can restablish the full compatibility. An interesting feature of AI2Offline is that is more simple to modify the manifest of the app.

There are differences between AI2 online and offline. This forum does not support AI2Offline, because the forum is built for AI2 online. If you need help with AI2Offline, join their forum and discuss there, else use AI2 online and discuss here.

Do you understand English? I wrote that my apps HAVE TO BE DESIGNED TO BE BUILT BY AI2 AND AI2OFFLINE. So, if a problem arises building or debugging on AI2 this is the right place. Instead of this type of racism, I think may be interesting to everyone learn how to build apps compatible with both. Start to imagine what means to do not be able to update an app because AI2 update, you are not able to come back to the last AI2 release able to build your app but you may have a chance using AI2Offline. So, as always, my company policy is to use online development tools taking care safety, security and maintenance. AI2 can be used because AI2Offline exists.

I read what you said and I understand it. But, as I said, if you are having issues with your AI2Offline app, join their forum. This forum's sole purpose is for AI2 Online (aka MIT App Inventor).

MIT App Inventor is AI2 Online. AI2Offline is created by a developer who does not work with the MIT.

I had the problem using AI2, then because I already used that extension since 2020 I tryed to rebuild a couple of apps and they did not have the problem. So I tryed to build the app using AI2Offline and I had the same problem. So I start to search info about the scanview extension and I found in the kodular forum that many others had the same problem and they solved it putting a BarcodeScanner instance in screen1. I do not understand what problem I have because until yesterday morning everything worked well but this trick solves my problem.

Please contact the author of this extension directly, with PM or in the thread where the extension is released.

Well, updates that AI2 makes (has to make) are, on the one hand, those

  • which add new/enhanced functions or those,
  • which are enforced by Google in August of each year.

If you offer "professional" apps, you will usually do so via the Play Store in particular. However, apps that do not meet the requirements of the respective targetSdk are no longer permitted there.

In this respect, your statement could only be true if your apps are not offered via the Play Store (which I would understand, but which doesn't look very professional).


I've also been working with AI2 offline versions (AI2U and later AI2Offline) for about ten years because it's faster, the AIA and APK size restrictions aren't there, internet independence (when traveling, on vacation) etc. But even though AI2Offline is completely based on AI2 based online, there are some (small) differences that unfortunately make compatibility difficult.

And as we have already seen from your other contributions, such problems ultimately turned out to be caused by AI2Offline.

1 Like

To remind you of another AI2Offline problem (Firebase related):

The above project isn't even working here a MIT

Check ScanView version on that app

Differences in versions

2.1 has Zxing Library (Isn't working with companion)
2.2 does not have Zxing Library hence you must have BarcodeScanner component

No, actually I have some apps done last year working also using companion and now with the solution found in Kodular also this app and my example work on AI2 with companion.