Android Question Parsing error in package message

johnaaronrose

Active Member
Licensed User
Longtime User
I have Debug (as opposed to Release) set in B4A. I've successfully connected to my Android 7.2 phone using B4A-Bridge. When I compile & run my app, it installs successfully. There's a problem in the app which causes my code to output a Msgbox. Immediately, before the MsgBox line, there is a line with a Log command. However, no result appears However, I do not see the above Log entry in B4A. Is there a way of seeing it on the connected phone?
PS I previously got a message in the B4A Log saying to add android:targetSdkVersion="19" to the Manifest after line android:minSdkVersion="4". I did as instructed but it still appears. Is this connected with this problem?
PPS Does the Log clear after each Compile & Run invocation?
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
No.


Yes (it can be changed under Tools - IDE Options).

Which version of B4A are you using?
Do you see anything in the logs?

Version 5.80.
There are some compiler warnings (besides the add android:targetSdkVersion="19" to the Manifest after line android:minSdkVersion="4" message) e.g.:
Variable declaration type is missing: String ... (Warning #5)
This sub should only be used... (warning #29)

The above warnings are difficult to correct as there is no clue as to which variable or sub they correspond to. Is there a way of finding out?

It would be helpful if I could copy the log as a set of characters rather than taking a screenshot (as attached). Is there a way?
 

Attachments

  • B4AScreenshot from 2017-09-12 09-20-59.png
    B4AScreenshot from 2017-09-12 09-20-59.png
    22.2 KB · Views: 205
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Is the Parsing Error that I get at runtime (on my phone attached by B4A-Bridge) because of the addition of the line android:targetSdkVersion="19"/> which I carried out in the Manifest Editor?
The full Manifest is:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
'Tap4Tap
AddApplicationText(
<activity android:name="com.tapfortap.TapForTapActivity"/>
)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The above warnings are difficult to correct as there is no clue as to which variable or sub they correspond to. Is there a way of finding out?

It would be helpful if I could copy the log as a set of characters rather than taking a screenshot (as attached). Is there a way?
Please start a new thread for each question.

If you are unable to see the logs with B4A-Bridge then you will need to switch to USB debug mode.
Note that the B4A-Bridge logging feature was improved in B4A v6.8.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Please start a new thread for each question.

If you are unable to see the logs with B4A-Bridge then you will need to switch to USB debug mode.
Note that the B4A-Bridge logging feature was improved in B4A v6.8.

This thread is concerned with the Parsing Error on the phone at runtime. Could the reason be, as asked in post #4, due to the change I made in the Manifest - this change was done because the compiler said that I should do it.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
When do you see the parsing error message? Can you post a screenshot?
I mislead you about the version numbers and the installation being Ok. I just changed the Version Code & Version Name (in Region Module Attributes for my Main Class module) to 10 from 9. However, when I did another Compile & Run (using B4-Bridge which shows as connected on both PC & Phone) then after getting the Parsing Error message. I tried to take a screenshot (using the Easy Screenshot app) but after invoking that app there's no way of getting back to the display of the Parsing Error popup. When I press the icon for my app, it starts from the old version - I don't get the Parsing Error popup and I checked using my app's About button (which has a textbox displayed containing the hard coded version number of 9 as opposed to the current code saying 10) and the App Inspector app shows that the installed version name & code are 9. Even though the window on my PC on compile & run shows that the install has completed successfully, it obviously has not - I can only assume that my app is running on a non-persistent version. I managed to take a screenshot of the Parsing Error after doing Compile & Run again!
 

Attachments

  • ParsingErrorScreenshot.png
    ParsingErrorScreenshot.png
    35.7 KB · Views: 203
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
I'm sorry to say but it is very difficult for me to read your posts and to help you.

Your app wasn't installed successfully.

Try to delete all the text in the manifest editor and save. This will restore the default text. See whether it solves this issue.

Sorry about my making my posts very difficult for you to understand. Summarising my previous post, the app is not installing on my phone even though my PC's Compile & Run window says that the install has completed successfully. I guess that this is due to the "Parse Error".

I've just tried deleting all the text in the Manifest Editor and saving it. When I started the Manifest Editor again, it created the default text. But I am still getting the "Parse Error" popup.

I've attached this new Manifest and my previous customised Manifest.
 

Attachments

  • DefaultManifest.txt
    563 bytes · Views: 227
  • MyManifest.txt
    668 bytes · Views: 252
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Are you able to use B4A Bridge and either step through or log messages to show when/where the error occurs?
I'm using B4A Bridge. I've put a simple MsgBox and Log command at the start of Activity_Create in Main module. The MsgBox does NOT display (i.e. execute) at runtime. The CatLog app shows that the Log command has NOT executed. Looking at the log, I don't see anything for my app.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I'm using B4A Bridge. I've put a simple MsgBox and Log command at the start of Activity_Create in Main module. The MsgBox does NOT display (i.e. execute) at runtime. The CatLog app shows that the Log command has NOT executed. Looking at the log, I don't see anything for my app.

So the code isn't executing the statements you think it should - is it executing something else or indeed stopping/sleeping?
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
So the code isn't executing the statements you think it should - is it executing something else or indeed stopping/sleeping?
The idea of using simple MsgBox and Log commands at the start of Activity_Create in Main module is to find out whether the app actually starts executing. As neither command executes at runtime, the app hasn't executed any of my code. So the problem is to do with installation (which has failed as shown by the App Inspector informing that it's an old version of the app) that is installed.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
So the App isn't executing anything? Is there a naming violation or something in the App or a missed End Sub or something silly?

Try these and come back to us...

Causes of the Parse error in Android?

Before we proceed to the fixes, let’s see what can cause Parse error in Android. The parse error occurs while installing an Android app on your phone. But, the causes can be different.

  • Parse error can occur if you have made changes to the app’s manifest file like changing the Android version.
  • It can also occur due to a corrupted .apk file or may because of a partially downloaded apk file.
  • Not enough permission to install third-party apps from unknown sources.
  • Your Android smartphone OS version or the hardware is not compatible with the app.
  • A third-party security application is blocking the app installation.
Are you able to post the full manifest file? Not the bits that you add, but the actual manifest file that is generated and used by your App - it will be in the Objects subdirectory for your App and called AndroidManifest.xml

Take care to remove any IDs or identifying info such as admob IDs etc...
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
So the App isn't executing anything? Is there a naming violation or something in the App or a missed End Sub or something silly?

Try these and come back to us...

Causes of the Parse error in Android?

Before we proceed to the fixes, let’s see what can cause Parse error in Android. The parse error occurs while installing an Android app on your phone. But, the causes can be different.

  • Parse error can occur if you have made changes to the app’s manifest file like changing the Android version.
  • It can also occur due to a corrupted .apk file or may because of a partially downloaded apk file.
  • Not enough permission to install third-party apps from unknown sources.
  • Your Android smartphone OS version or the hardware is not compatible with the app.
  • A third-party security application is blocking the app installation.
Are you able to post the full manifest file? Not the bits that you add, but the actual manifest file that is generated and used by your App - it will be in the Objects subdirectory for your App and called AndroidManifest.xml

Take care to remove any IDs or identifying info such as admob IDs etc...

Version name & code are same as in Main module's Region Attributes.
I didn't see any messages or log entries about the apk file.
I have permission to install 3rd party apps from unknown sources set.
I'm using a Wileyfox phone with LineageOSfor version of Android 7.1 installed (previous version of app installed from an apk file before I installed LineageOS runs Ok).
My phone is rooted and I use Greenify: hopefully that doesn't block the app's installation as it doesn't block installation of other apps.

Full manifest file attached. This is one generated after I cleared the file in B4A's Manifest Editor and saved it which made it go to the default one as I said in a previous post.
 

Attachments

  • AndroidManifest.xml
    3 KB · Views: 260
Upvote 0
Top