Android Question [SOLVED]The compilation was successful but an error occurred after b4a-Bridge received it

Jones Hone

Active Member
Licensed User
Longtime User
I use B4A-Bridge v2.67 to connect to my phone. Compile using Release Mode.
I compiled successfully without any error messages.
B4X:
B4A Version: 12.50
Parsing code.    (0.33s)
    Java Version: 19
Building folders structure.    (0.05s)
Compiling code.    (0.32s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.05s)
Linking resources    (0.47s)
Compiling generated Java code.    (0.05s)
Finding libraries that need to be dexed.    (0.01s)
Dex code    (0.73s)
Dex merge    (4.83s)
Copying libraries resources    (1.34s)
ZipAlign file.    (0.05s)
Signing package file (debug key).    (0.58s)
Installing file to device.    (0.06s)
    Installing with B4A-Bridge.
Completed successfully.
However, b4a-Bridge immediately displays the following message after receiving it.

剖析套件時發生問題 (A problem occurred while parsing the package(My phone is in Chinese so I translated the message))
(This message appears before the installation starts, and then it ends)

Although I have #Bridgelogger: True, no message appears.

My phone is Redmi Note 9, Android 12.
This APP has been used on this phone for 2 years. This APP has not been changed for about half a year. I want to modify it today but this problem appears before I modify it.
I have also used this environment to develop other apps recently, and everything is normal!
Because there is absolutely no error message, I really don't know where to start troubleshooting.
Can someone help me where to check? Thanks!
 

watesoft

Active Member
Licensed User
Longtime User
I use B4A-Bridge v2.67 to connect to my phone. Compile using Release Mode.
I compiled successfully without any error messages.
B4X:
B4A Version: 12.50
Parsing code.    (0.33s)
    Java Version: 19
Building folders structure.    (0.05s)
Compiling code.    (0.32s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.05s)
Linking resources    (0.47s)
Compiling generated Java code.    (0.05s)
Finding libraries that need to be dexed.    (0.01s)
Dex code    (0.73s)
Dex merge    (4.83s)
Copying libraries resources    (1.34s)
ZipAlign file.    (0.05s)
Signing package file (debug key).    (0.58s)
Installing file to device.    (0.06s)
    Installing with B4A-Bridge.
Completed successfully.
However, b4a-Bridge immediately displays the following message after receiving it.

剖析套件時發生問題 (A problem occurred while parsing the package(My phone is in Chinese so I translated the message))
(This message appears before the installation starts, and then it ends)

Although I have #Bridgelogger: True, no message appears.

My phone is Redmi Note 9, Android 12.
This APP has been used on this phone for 2 years. This APP has not been changed for about half a year. I want to modify it today but this problem appears before I modify it.
I have also used this environment to develop other apps recently, and everything is normal!
Because there is absolutely no error message, I really don't know where to start troubleshooting.
Can someone help me where to check? Thanks!
Don't check this. You will see all possible problems.

1740979062277.png
 
Upvote 0

Jones Hone

Active Member
Licensed User
Longtime User
1.Upgrade B4A to 13.1
2. Post your manifest
Same problem using b4a 13.1!
The manifest is as follows:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="tw.changfon.vpadmos"
    android:versionCode="1"
    android:versionName="3.0"
    android:installLocation="internalOnly">
    
    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>
    <supports-screens android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:anyDensity="true"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <application
        android:name="androidx.multidex.MultiDexApplication"
        android:icon="@drawable/icon"
        android:label="Order APP"
        android:theme="@style/DarkTheme">
        
        <receiver android:name="anywheresoftware.b4a.objects.AdminReceiver2"
                 android:permission="android.permission.BIND_DEVICE_ADMIN">
                  <meta-data android:name="android.app.device_admin"
                 android:resource="@xml/device_admin" />
            <intent-filter>
                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
            </intent-filter>
        </receiver>
        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="barcode,face" />
        <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
          android:theme="@android:style/Theme.Translucent.NoTitleBar"
          android:exported="false"/>
            <meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" />
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".main"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
            <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            
        </activity>
        <service
            android:name=".starter"
            android:exported="true">
        </service>
        <receiver
            android:name=".starter$starter_BR"
            android:exported="true">
        </receiver>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmedit"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmorder"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmlist"
            android:label="活力點菜APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmnote"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmnow"
            android:label="活力點菜APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmopen"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmregs"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmresend"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".frmsetnew"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <service
            android:name=".reboot"
            android:exported="true">
        </service>
        <receiver
            android:name=".reboot$reboot_BR"
            android:exported="true">
        </receiver>
        <service
            android:name=".ss"
            android:exported="true">
        </service>
        <receiver
            android:name=".ss$ss_BR"
            android:exported="true">
        </receiver>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".update"
            android:label="Order APP"
            android:screenOrientation="unspecified"
            android:exported="true">
        </activity>
        <receiver
            android:name=".httputils2service"
            android:exported="true">
        </receiver>
    </application>
</manifest>
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Try to change targetSdkVersion to 31 or below
 
Last edited:
Upvote 0
Solution

Jones Hone

Active Member
Licensed User
Longtime User
change targetSdkVersion to 30, It can be installed,
but a strange error occurs when executing!
It has already been initialize, but it says object first be initialized!
Don’t know what the problem is?
b4a-3.jpg
 
Upvote 0

teddybear

Well-Known Member
Licensed User
It has already been initialize, but it says object first be initialized!
Apparently, File.ListFiles is failed, what is AppPath?
 
Upvote 0

Jones Hone

Active Member
Licensed User
Longtime User
AppPath is a variable whose content is a valid and existing path name.
The app was not given read and write permissions. After granting them, everything worked fine.
But another error occurred!
Let me research what the error is!
If I can't solve it, I'll ask you guys for help!

熊辉 謝謝您的指點!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
It has already been initialize, but it says object first be initialized!
You need to understand how it works!
Yes, you initialized the Object but in the nextline your get and UNINITIALIZED list back as file.listfiles returns nothing.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
AppPath is a variable whose content is a valid and existing path name.
The app was not given read and write permissions. After granting them, everything worked fine.
But another error occurred!
Let me research what the error is!
If I can't solve it, I'll ask you guys for help!
For the topic of the thread, it has been solved by changing targetSdkVersion , this is another question, you'd better create a new thread for ask
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
It has already been initialize, but it says object first be initialized!
Don’t know what the problem is?

You have to check if the list is initialized
1740996524002.png


B4X:
    Dim DirS As List
    DirS = File.ListFiles(Starter.Application_ErrorPath & "/Bak")
    If DirS.IsInitialized Then    
        For i = 0
            ....
        Next
    Else
        Log("There was an error reading the path")
    End If
 
Upvote 0
Top