My apps "autoupdate" not working Rio 10.3.1 (Tokyo 10.2.3 working)

procedure Update_apk;
var
  Path: JString;
  Name: JString;
  F: Jfile;
  Intent: JIntent;
  FileName: string;
begin
  FileName := System.IOUtils.TPath.Combine( *** this will be the dowload path and the APK name of the program *** );
  Path := StringToJString(System.IOUtils.TPath.GetDirectoryName(FileName));
  Name := StringToJString(System.IOUtils.TPath.GetFileName(FileName));
  F := TJfile.JavaClass.init(Path, Name);
//
  Intent := TJIntent.Create();
  Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
  Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
  Intent.setDataAndType(TJnet_Uri.JavaClass.fromFile(F), StringToJString('application/vnd.android.package-archive'));
//
  TAndroidHelper.Context.startActivity(Intent);
//
  Application.Terminate();
//
end;

I download the MY_APPS.APK-file from the server my phone download folder.

The download is correct, the file is in the download folder.

Then i run Update_apk-procedure -> the app just closes.

Workin fine Tokyo 10.2.3, not Rio 10.3.1

Why?!?!?!

Parents
No Data
Reply
  • Phone is Samsung XCOVER4 android 8.1.0

    monitor.bat like this:

    I don't understand anything about this...

    03-29 11:01:21.193: W/System.err(20523): android.os.FileUriExposedException: file:///storage/emulated/0/Download/DataArkisto.apk exposed beyond app through Intent.getData()
    03-29 11:01:21.194: W/System.err(20523): at android.os.StrictMode.onFileUriExposed(StrictMode.java:1960)
    03-29 11:01:21.194: W/System.err(20523): at android.net.Uri.checkFileUriExposed(Uri.java:2356)
    03-29 11:01:21.194: W/System.err(20523): at android.content.Intent.prepareToLeaveProcess(Intent.java:10635)
    03-29 11:01:21.195: W/System.err(20523): at android.content.Intent.prepareToLeaveProcess(Intent.java:10589)
    03-29 11:01:21.195: W/System.err(20523): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1618)
    03-29 11:01:21.195: W/System.err(20523): at android.app.Activity.startActivityForResult(Activity.java:4621)
    03-29 11:01:21.195: W/System.err(20523): at android.app.Activity.startActivityForResult(Activity.java:4579)
    03-29 11:01:21.196: W/System.err(20523): at android.app.Activity.startActivity(Activity.java:4940)
    03-29 11:01:21.196: W/System.err(20523): at android.app.Activity.startActivity(Activity.java:4908)
    03-29 11:01:21.196: W/System.err(20523): at com.embarcadero.rtl.ProxyInterface.dispatchToNative(Native Method)
    03-29 11:01:21.196: W/System.err(20523): at com.embarcadero.rtl.ProxyInterface.invoke(ProxyInterface.java:21)
    03-29 11:01:21.197: W/System.err(20523): at java.lang.reflect.Proxy.invoke(Proxy.java:913)
    03-29 11:01:21.197: W/System.err(20523): at $Proxy5.run(Unknown Source)
    03-29 11:01:21.197: W/System.err(20523): at android.os.Handler.handleCallback(Handler.java:790)
    03-29 11:01:21.197: W/System.err(20523): at android.os.Handler.dispatchMessage(Handler.java:99)
    03-29 11:01:21.197: W/System.err(20523): at android.os.Looper.loop(Looper.java:164)
    03-29 11:01:21.198: W/System.err(20523): at android.app.ActivityThread.main(ActivityThread.java:7000)
    03-29 11:01:21.198: W/System.err(20523): at java.lang.reflect.Method.invoke(Native Method)
    03-29 11:01:21.198: W/System.err(20523): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
    03-29 11:01:21.198: W/System.err(20523): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

    Manifest like this:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- BEGIN_INCLUDE(manifest) -->
    <manifest xmlns:android="">schemas.android.com/.../android"
    package="com.embarcadero.DataArkisto"
    android:versionCode="1"
    android:versionName="1.0.0"
    android:installLocation="auto">

    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="False"
    android:restoreAnyVersion="False"
    android:label="DataArkisto"
    android:debuggable="True"
    android:largeHeap="False"
    android:icon="@drawable/ic_launcher"
    android:theme="@style/AppTheme"
    android:hardwareAccelerated="true"
    android:resizeableActivity="false">


    <!-- 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="DataArkisto"
    android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
    android:launchMode="singleTask">
    <!-- Tell NativeActivity the name of our .so -->
    <meta-data android:name="android.app.lib_name"
    android:value="DataArkisto" />
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />

    </application>
    </manifest>
    <!-- END_INCLUDE(manifest) -->

Children