Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EACCES issues on API level 29 (Android 10) #259

Closed
PedaB opened this issue Jul 9, 2020 · 0 comments
Closed

EACCES issues on API level 29 (Android 10) #259

PedaB opened this issue Jul 9, 2020 · 0 comments
Labels

Comments

@PedaB
Copy link

PedaB commented Jul 9, 2020

Today my Android phone did an update to Android 10. After that I got many errors in OSMTracker. Recording Audio, making a note, exporting to GPX,.. basically everything produced an error. The most meaningful one was while trying to write debug infos. OSMTracker basically stated "EACCES (permission denied)".

Googling this suggests, that this is a new security "feature" in Android 10 disallowing to write to directories the App doesn't "own" or so. In API level 29 there seems to be a workaround, adding an attribute to replicate the old behavior of Android <10. Applying the patch below against master solves the issue for me (thanks to @tordanik for helping to build 😃). However, I assume this needs to be fixed properly by someone with knowledge of Android.

diff --git a/app/build.gradle b/app/build.gradle
index 2b72e63..ffbce7c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -3,13 +3,13 @@ apply plugin: 'com.android.application'
 android {
 
     useLibrary 'org.apache.http.legacy'
-    compileSdkVersion 28
-    buildToolsVersion = '28.0.3'
+    compileSdkVersion 29
+    buildToolsVersion = '29.0.0'
 
     defaultConfig {
         applicationId "net.osmtracker"
-        minSdkVersion 16
-        targetSdkVersion 28
+        minSdkVersion 21
+        targetSdkVersion 29
         multiDexEnabled true
 
         testApplicationId "net.osmtracker.test"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 32bd95f..ec2b772 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,7 +12,7 @@
 	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
-	<application android:label="@string/app_name" android:description="@string/app_description" android:icon="@drawable/ic_launcher" android:theme="@style/HighContrast">
+	<application android:requestLegacyExternalStorage="true" android:label="@string/app_name" android:description="@string/app_description" android:icon="@drawable/ic_launcher" android:theme="@style/HighContrast">
 
 		<uses-library android:name="org.apache.http.legacy" android:required="false"/>
@jamescr jamescr added the bug label Aug 29, 2020
@jamescr jamescr added this to the v1.0.0-beta3 milestone Aug 29, 2020
jamescr added a commit to jamescr/osmtracker-android that referenced this issue Jan 10, 2021
@jamescr jamescr modified the milestones: v1.0.0-beta3, v1.0.0-rc1 Jan 29, 2021
@jamescr jamescr removed this from the v1.0.0-rc1 milestone Feb 13, 2021
@jamescr jamescr closed this as completed Feb 13, 2021
@jamescr jamescr reopened this Feb 13, 2021
@jamescr jamescr closed this as completed in 32ef57e Mar 2, 2021
@jamescr jamescr mentioned this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants