JSCallback Error: Request failed., source: file:///android_asset/www/js/phonegap.0.9.4.js


The Android sdk 7 version of the app developed using phonegap should be updated to Android sdk 16.

The following issues occur during this process:

I/chromium: [INFO:CONSOLE(0)] "Access to XMLHttpRequest at '' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", source: file:///android_asset/www/index.html (0)
I/chromium: [INFO:CONSOLE(711)] "JSCallback Error: Request failed.", source: file:///android_asset/www/js/phonegap.0.9.4.js (711)
D/NetworkManagementSocketTagger: tagSocket(180) with statsTag=0xffffffff, statsUid=-1
D/NetworkManagementSocketTagger: tagSocket(184) with statsTag=0xffffffff, statsUid=-1

I can't solve this problem, and I'd like to avoid developing the app again in the worst case scenario.

The current app has the following structure:

apply plugin: 'com.android.application'

android {
   compileSdkVersion 16
   buildToolsVersion "25.0.2"

   defaultConfig {
      applicationId "<my-package-name>"
      minSdkVersion 16
      targetSdkVersion 16
      project.ext.set("archivesBaseName", "<my-package-name>");

   buildTypes {
      release {
         minifyEnabled true
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
 //   debug {
 //      minifyEnabled true
 //      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
 //   }  

 repositories {
     flatDir {
        dirs 'libs'

 dependencies {
    compile 'com.android.support:support-v4:19+'
    compile files('libs/ap_android.1.4.0.jar')
    compile files('libs/droidx3_manager_3.0.22.922.jar')
    compile files('libs/MagicMRS_20130729.jar')
    compile files('libs/MagicSE2.jar')
    compile files('libs/MagicXSign.jar')
    compile '<my-package-name>:MDMLib@aar'
    compile files('libs/NFilterKeyPad-4.1.8.jar')
    compile files('libs/nSafer.1.1.3.a.jar')
    compile files('libs/phonegap.0.9.4_v2.1.jar')
    compile files('libs/wmqtt.jar')
    compile files('libs/XSignWebViewPlugin_201307302.jar')

    provided 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'

There are no related errors in version sdk 7.

At first, I thought I only needed to update related lib files, but I couldn't find a phongap .jar file that supports android sdk 16 or higher.

If you know anything about this situation, I want you to help me.


asked on Stack Overflow Dec 22, 2019 by 맛동산 • edited Dec 22, 2019 by 맛동산

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0