Android Question #AdditionalJar, Attribute not supported

Computersmith64

Well-Known Member
Licensed User
Longtime User
Upvote 0

rkmoray

Active Member
Licensed User
Longtime User
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: True
#End Region
#AdditionalJar: com.google.android.gms:play-services-vision
#Extends: android.support.v7.app.AppCompatActivity
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private mSoundPool As SoundPool
Private mSPFail As Int ' Sound Pool Load ID
Private mSPsuccess As Int ' Sound Pool Load ID
'Private nativeMe As JavaObject
Private frontCamera As Boolean = False
Private detector As JavaObject
Private SearchForBarcodes As Boolean
Private LastPreview As Long
Private IntervalBetweenPreviewsMs As Int = 100
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What version of B4A are you using?
 
Upvote 0

rkmoray

Active Member
Licensed User
Longtime User
I think I found the issue.
#AdditionalJar needs to be in the "main" module.
When I [put it is any other module ("scan") it gives me an error.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I think I found the issue.
#AdditionalJar needs to be in the "main" module.
When I [put it is any other module ("scan") it gives me an error.

Yes - because it has to go in the Project Attributes region, which is only in your main activity:

B4X:
#Region  Project Attributes
    #ApplicationLabel:
    #VersionCode:
    #VersionName:
    #AdditionalJar: com.google.android.gms:play-services-vision
    #Extends: android.support.v7.app.AppCompatActivity
#End Region

Also, when you're posting code to the forum use code tags - it makes it much easier to read.

- Colin.
 
Last edited:
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Note that #region elements are never required. They are just used to create a collapsible element in the IDE.
Huh - I did not know that! Good to know for future reference.

- Colin.
 
Upvote 0
Top