Voltbuild compile fail - phonegap-plugin-barcodescanner

i got compile failed on today voltbuild.
I have this plugin

plugin name=“phonegap-plugin-barcodescanner” source=“npm” spec=“6.0.8”

Errors in log

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script ‘/platforms/android/phonegap-plugin-barcodescanner/oetms-barcodescanner.gradle’ line: 3

  • What went wrong:
    A problem occurred evaluating script.

Could not get unknown property ‘cdvMinSdkVersion’ for project ‘:app’ of type org.gradle.api.Project.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

compileSdkVersion is not specified. Please add it to build.gradle

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

any solutions?
Teo

Check out this document on changes for Android 12. There is an updated version of this plugin.

i use following plugin in my project

<plugin name="cordova-plugin-inappbrowser" source="npm" spec="3.1.0" />
<plugin name="cordova-plugin-camera" source="npm"  />
<plugin name="cordova-plugin-device" source="npm" />
<plugin name="cordova-plugin-contacts" source="npm" />
<plugin name="phonegap-plugin-barcodescanner" source="npm" />
<plugin name="cordova-plugin-bluetooth-serial" source="npm" /> 

when using engine name=“android” spec=“11.0.0” , all plug in failed to compile.
Anyone know the above plugin definition for android 12 (phonegap-plugin-barcodescanner >> phonegap-plugin-barcodescanner-android12)

since i force to use engine name=“android” spec=“10.1.2”, is this mean my app is not able to run in android 12?

Thanks
Teo

There are a few things you need to do to make your apps ready for Android 12. You’ll find a list of them here:

You should be using engine 11 now - if you don’t specify the engine, it will use that as the default.

phonegap-plugin-barcodescanner-android12 should work fine with engine 11.

nothing help in this document. Currently my newly compile apk has another issue Ajax always return 0

Any idea?
Thanks

If it compiles cleanly, you’re probably OK.

This sounds like a runtime issue. To debug, use the Remote Debugger.

ajax return error as follow
NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: failed to load “url…”

Any ideas to solve

Can you show the complete error message?

Are there any other messages on the console?

I cant get remote debugger to connect to my device. the error was return as statustext after ajax call

    if req.status<>200 then
      prompt(req.statusText)
    end if ````
req.statustext :

NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: failed to load “url…”

You’ll need to get the Remote Debugger working. I suspect there will be an error on the console which will reveal the problem.

Are you making a debug build?

no, it is release build

You can’t debug a release build. Use debug.

this is message at debugger

Access to XMLHttpRequest at ‘https://app.oetapp.com/OETmxs/includes/OETSignIn.asp’ from origin ‘https://localhost’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

any solutions

Thanks

after wasting much time to try. i got the solution by adding

<preference name="AndroidInsecureFileModeEnabled" value="true" />

in config.xml

Thanks for posting the solution!