I got this error with AI2Offline - Companion: Argument(package protect-enum

I got this error: Argument(package protect-enum, Unkown, version 0.0) to 'apply-to-args has wrong type (java.lang.Package)(expected:procedure)))'
when I use File.MakeFullPath.

I am using AI2OFFLINE.

Anybody have get this error?

1 Like

Your own offline AI2?

Working fine for me on online version, Android 11.


I posted about it twice:

1 Like

Yes, I changed the topic.

thanks but I am using the wifi connection, not USB.

So no solution until now?

Oh, sorry. I didn't get this error with WiFi. I'll check it again ...
Which version of AI2Offline?

I went to GitHub and checked the source for MakeFullPath.

  public String MakeFullPath(FileScope scope, String path) {
    return FileUtil.resolveFileName(form, path, scope);

The resolveFileName is here.

  public static String resolveFileName(Form form, String fileName, FileScope scope) {
    File path;
    if (fileName.startsWith("//")) {  // Asset files in legacy mode
      path = new File(form.getAssetPath(fileName.substring(2)).substring(7));
    } else if (scope == FileScope.App && Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
      path = new File(form.getExternalFilesDir(""), fileName);
    } else if (scope == FileScope.Asset) {
      path = new File(form.getAssetPath(fileName).substring(7));
    } else if (scope == FileScope.Cache) {
      path = new File(form.getCachePath(fileName).substring(7));
    } else if ((scope == FileScope.Legacy || scope == null) && fileName.startsWith("/")) {
      path = new File(QUtil.getExternalStorageDir(form, false, true), fileName.substring(1));
    } else if (scope == FileScope.Private) {
      path = new File(form.getPrivatePath(fileName).substring(7));
    } else if (scope == FileScope.Shared) {
      path = new File(Environment.getExternalStorageDirectory() + "/" + fileName);
    } else if (!fileName.startsWith("/")) {  // Private files in legacy mode
      path = new File(form.getPrivatePath(fileName).substring(7));
    } else {
      /* Starting with nb186, files will be placed in different locations when the file name starts
       * with a single "/" character. For Android Q and later, this is the app-specific directory
       * on external storage. For Android versions prior to Q, it will be the root of the external
       * storage, such as /sdcard or /storage/external/0/.
      path = getExternalFile(form, fileName.substring(1), scope);
    return Uri.fromFile(path).toString();

Doesn't seem buggy.

the one with a frog as logo, version:

in fact not only this block, also other block like copyFile also same.

I checked it:

I've never used the *.exe version.

I think they are same, the exe one give user UI to start / stop server.

I restart my computer, still same error with wifi connection.

Companion version? Which browser?


Companin version 2. 62
Browser Chrome v95




Tested on Firefox too, same.

test on firefox v98, same error.

Strange, OS?

I'll test it later with my Mac.
Tested on Win7 Pro.