Android Question google Maps B4A 8.8.0

David Perugachi

New Member
Licensed User
Dear, good afternoon we have acquired a license of B4A Professional.

We need to develop an application that uses google maps. I have followed the following tutorial to the letter:

https://www.b4x.com/android/forum/threads/google-maps.63930/#post-404386


I have installed the necessary libraries of maven and generated my Key to use the api of Google Maps but whenever I try to compile to carry out the tests it indicates me the following error:


 

Attachments

DonManfred

Expert
Licensed User
I have installed the necessary libraries of maven and generated my Key to use the api of Google Maps but whenever I try to compile to carry out the tests it indicates me the following error
1. Post Errors as TEXT (right click to copy it)
2. No need to upload googlemap library. Instead you should upload your not working project.
 

David Perugachi

New Member
Licensed User
:null,0
java.lang.ClassNotFoundException: anywheresoftware$b4a$objects$RuntimePermissions
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:639)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:611)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:366)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.starter.onCreate(starter.java:48)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544)
at android.app.ActivityThread.access$1300(ActivityThread.java:205)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:280)
at android.app.ActivityThread.main(ActivityThread.java:6706)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

my file manifest:

AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:hardwareAccelerated="false"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCvrXI-XcbBiBifAPd6B9byS4_BLObLxH0"/>
)
AddManifestText(
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.INTERNET"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.READ_GSERVICES"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.MAPS_RECEIVE"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"
android:maxSdkVersion="26" />
)
AddManifestText(
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="19" />
)
 

DonManfred

Expert
Licensed User
You should Export the project as zip (in the Ide: File->Export as Zip) and upload this zip.
It is much easier to help if one can check the full source.
If your app is a complex one or confidential then you should create a small testproject with just the map and upload this project.
Make sure to use runtimepermissions if you want to use your location. You manifest does contains a lot of lines which are not needed.

Notes
-
You should set the My Location Enabled property to False in the designer and enable it after you request the permission:
Example: https://www.b4x.com/android/forum/t...ty-exemptions-on-android-7.88995/#post-563422
 

David Perugachi

New Member
Licensed User
You should Export the project as zip (in the Ide: File->Export as Zip) and upload this zip.
It is much easier to help if one can check the full source.
If your app is a complex one or confidential then you should create a small testproject with just the map and upload this project.
Make sure to use runtimepermissions if you want to use your location. You manifest does contains a lot of lines which are not needed.

Notes
-
You should set the My Location Enabled property to False in the designer and enable it after you request the permission:
Example: https://www.b4x.com/android/forum/t...ty-exemptions-on-android-7.88995/#post-563422
 

Attachments

DonManfred

Expert
Licensed User
1. I ADDED the missing GooglePlay snippet from the tutorial
2. I removed all the other Entries
3. I changed minsdk to 14 (like told in tutorial)
4. I added Anchors to the Mapfragement in designer. But this is just a cosmetic Issue ;-)

To run the Project attached please edit the Manifest and add your Apikey. I´ve removed it for the upload.
Please remove the projectupload from your post too.
 

Attachments

Last edited:

David Perugachi

New Member
Licensed User
1. I ADDED the missing GooglePlay snippet from the tutorial
2. I removed all the other Entries
3. I changed minsdk to 14 (like told in tutorial)
4. I added Anchors to the Mapfragement in designer. But this is just a cosmetic Issue ;-)

To run the Project attached please edit the Manifest and add your Apikey. I´ve removed it for the upload.
Please remove the projectupload from your post too.

Thank you very much, it worked very well :)
 
Top