AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Die Delphi-IDE Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

Ein Thema von Jef · begonnen am 6. Aug 2019 · letzter Beitrag vom 21. Aug 2019
Antwort Antwort
Jef

Registriert seit: 8. Sep 2013
Ort: München
40 Beiträge
 
Delphi 10.3 Rio
 
#1

AW: Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

  Alt 20. Aug 2019, 15:55
Nach einer sauberen Neuinstallation habe ich keine Probleme mehr mit dem SDK Manager. Auch der Pfad zum Projekt ist radikal runtergekürzt.

Trotzdem bekomme ich eine einfache Karte auf Android 9 nicht zum Laufen (bei Android 8 klappt es).

Zu meinem Testprojekt:
im Form liegt nur eine TMapview
in der Berechtigungsliste ist der Kartendienst auf true
die Berechtigungen: Internet, genauer Standort, ungefährer Standort
ein gültiger API Key ist in den Versionsinformationen eingetragen

Folgender Code in der .pas (auf Basis der aktuellen Demo "Map Type Selector" mit der neuen RequestPermissions Abfrage):
Code:
unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,

  System.Permissions,

  FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FMX.ListBox, FMX.Edit,
  FMX.Maps;

type
  TForm1 = class(TForm)
    MapView1: TMapView;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    FPermissionFineLocation: string;
    procedure LocationPermissionRequestResult(Sender: TObject; const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>);
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
{$IFDEF ANDROID}
  Androidapi.Helpers,
  Androidapi.JNI.JavaTypes,
  Androidapi.JNI.Os,
{$ENDIF}
  FMX.DialogService;

{$R *.fmx}

procedure TForm1.FormCreate(Sender: TObject);
begin
{$IFDEF ANDROID}
  FPermissionFineLocation := JStringToString(TJManifest_permission.JavaClass.ACCESS_FINE_LOCATION);
{$ENDIF}
  PermissionsService.RequestPermissions([FPermissionFineLocation], LocationPermissionRequestResult);
end;

procedure TForm1.LocationPermissionRequestResult(Sender: TObject; const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>);
begin
  // 2 permissions involved: ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION
  if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then
  begin
    MapView1.ControlOptions := MapView1.ControlOptions + [TMapControlOption.MyLocation];
    MapView1.LayerOptions := MapView1.LayerOptions + [TMapLayerOption.UserLocation];
  end;
end;

end.
Meine Testgeräte:
- Samsung S5 mit Lineage auf Basis von Android 8: die App startet korrekt
- ein Fairphone 2 mit Lineage auf Basis von Android 9: die App startet nicht

Was mache ich mit dieser Debugger Meldung (nur Andriod 9)?
Erste Gelegenheit für Exception bei $8CD1E0A1. Exception-Klasse EJNIException mit Meldung 'java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />'. Prozess Project1.apk (19416)

Die geänderte Manifest XML schaut jetzt so aus:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="%package%"
        android:versionCode="%versionCode%"
        android:versionName="%versionName%"
        android:installLocation="%installLocation%">

    <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
    <%uses-permission%>
    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="%persistent%"
        android:restoreAnyVersion="%restoreAnyVersion%"
        android:label="%label%"
        android:debuggable="%debuggable%"
        android:largeHeap="%largeHeap%"
        android:icon="%icon%"
        android:theme="%theme%"
        android:hardwareAccelerated="%hardwareAccelerated%"
        android:resizeableActivity="false">
        <%provider%>
        <%application-meta-data%>
        <%services%>
        <!-- Our activity is a subclass of the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                android:label="%activityLabel%"
                android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                android:launchMode="singleTask">
            <!-- Tell NativeActivity the name of our .so -->
            <meta-data android:name="com.google.android.gms.version"
                       android:value="@integer/google_play_services_version" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <%activity%>
        <%receivers%>
    </application>
</manifest>
<!-- END_INCLUDE(manifest) -->
Das brachte auch keinen Erfolg
Sebastian
  Mit Zitat antworten Zitat
Benutzerbild von MEissing
MEissing

Registriert seit: 19. Jan 2005
Ort: Egelsbach
1.384 Beiträge
 
Delphi 12 Athens
 
#2

AW: Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

  Alt 20. Aug 2019, 16:08
Google Services installiert / aktiviert?

LineageOS ohne GApps funktioniert halt nicht....
Matthias Eißing
cu://Matthias.Eißing.de [Embarcadero]
Kein Support per PN
  Mit Zitat antworten Zitat
Jef

Registriert seit: 8. Sep 2013
Ort: München
40 Beiträge
 
Delphi 10.3 Rio
 
#3

AW: Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

  Alt 20. Aug 2019, 16:40
GApps ist auf beiden Testgeräten drauf. PlayStore, GoogleKonto, Mail, Maps usw. laufen.
Sebastian
  Mit Zitat antworten Zitat
Benutzerbild von MEissing
MEissing

Registriert seit: 19. Jan 2005
Ort: Egelsbach
1.384 Beiträge
 
Delphi 12 Athens
 
#4

AW: Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

  Alt 21. Aug 2019, 09:20
Die projektspezifische Android Template Datei mal löschen-> neu erstellen lassen/einstellen..
Matthias Eißing
cu://Matthias.Eißing.de [Embarcadero]
Kein Support per PN
  Mit Zitat antworten Zitat
Darlo

Registriert seit: 28. Jul 2008
Ort: München
1.196 Beiträge
 
Delphi 10.2 Tokyo Enterprise
 
#5

AW: Delphi 10.2.3 VERSUS Delphi 10.3.2 - TMapView

  Alt 21. Aug 2019, 09:34
Scheint in der Tat ein Bug zu sein. Getestet auf Android 9

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  lMapView: TMapView;
begin
  lMapView := TMapView.Create(self);
end;
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt Map_ObjectPascal.apk ist eine Exception der Klasse EJNIException mit der Meldung 'java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.ClassLoader java.lang.Class.getClassLoader()' on a null object reference' aufgetreten.
---------------------------
Anhalten Fortsetzen Hilfe
---------------------------
Philip
  Mit Zitat antworten Zitat
Antwort Antwort

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:01 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz