回答編集履歴

3

内容の修正

2019/09/01 09:00

投稿

退会済みユーザー
test CHANGED
@@ -1,7 +1,3 @@
1
- ## 回答(修正版)
2
-
3
-
4
-
5
1
  SocialConnectorプラグインの[SocialConnector.cs](https://github.com/anchan828/social-connector/blob/master/Assets/SocialConnector/SocialConnector.cs)に以下の記述があります。
6
2
 
7
3
 
@@ -24,56 +20,48 @@
24
20
 
25
21
 
26
22
 
27
- 注目すべき点は、ファイルプロバイダに`android.support.v4.content.FileProvider`が指定されていることです。
23
+ 注目すべき点は、ファイルプロバイダに`android.support.v4.content.FileProvider`が指定されていることです。`android.support.v4.content.FileProvider`を使用できるようにする必要があります。
28
24
 
29
25
 
30
26
 
31
- compileSdkVersionが29場合、`androidx.core.content.FileProvider`を使用する必要ので、SocialConnectorプラグインは使用できせん
27
+ AndroidManifest.xmlファイルプロバイダに`android.support.v4.content.FileProvider`が指定されていことを確認し
32
-
33
-
34
-
35
- 解決方法(妥協案)としては、
36
-
37
- * 他のプラグインを使用する
38
-
39
- * compileSdkVersionを28にする(=AndroidXに対応しない)
40
-
41
- * (ライセンスに問題がなければ)SocialConnectorプラグインを自分で改造する
42
-
43
-
44
-
45
- といった方法があります。
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
- ---
54
-
55
- ## 回答(旧版)
56
-
57
- AndroidManifest.xmlのproviderの記述を以下のよう変更にすると、解決するかもしれません。
58
-
59
-
60
28
 
61
29
  ```xml
62
30
 
63
31
  <provider
64
32
 
65
- android:name="androidx.core.content.FileProvider"
33
+ android:name="android.support.v4.content.FileProvider"
66
34
 
35
+ android:authorities="com.Company.Tamago.fileprovider"
36
+
67
- <!-- 以下略 -->
37
+ android:exported="false"
38
+
39
+ android:grantUriPermissions="true">
68
40
 
69
41
  ```
70
42
 
71
43
 
72
44
 
73
- ---
45
+ gradle.propertiesに以下のプロパティがある場合、
74
46
 
47
+ ```
48
+
49
+ android.useAndroidX=false
50
+
51
+ android.enableJetifier=false
52
+
53
+ ```
54
+
55
+ に変更し、build.gradle(Module: app)のdependencies内に
56
+
57
+ ```
58
+
75
- 私自身もまだ分かっていないことが多いのですが、android.support.*ライブラリの更新がバージョン28で止まり、androidx.*ライブラリに切り替わったことが原因かもしれません。
59
+ implementation 'com.android.support:support-compat:28.0.0'
60
+
61
+ ```
62
+
63
+ を追記します。
76
64
 
77
65
 
78
66
 
79
- 参考:[Android Developers - Support Library の機能ガイド](https://developer.android.com/topic/libraries/support-library/features?hl=JA)
67
+ [File]>[Sync Project with Gradle Files]し、[Build]>[Rebuild Project]します。

2

不要な線を除去

2019/09/01 09:00

投稿

退会済みユーザー
test CHANGED
@@ -1,5 +1,3 @@
1
- ---
2
-
3
1
  ## 回答(修正版)
4
2
 
5
3
 

1

回答の修正

2019/08/31 08:16

投稿

退会済みユーザー
test CHANGED
@@ -1,3 +1,61 @@
1
+ ---
2
+
3
+ ## 回答(修正版)
4
+
5
+
6
+
7
+ SocialConnectorプラグインの[SocialConnector.cs](https://github.com/anchan828/social-connector/blob/master/Assets/SocialConnector/SocialConnector.cs)に以下の記述があります。
8
+
9
+
10
+
11
+ ```cs
12
+
13
+ if(24 <= apiLevel) {
14
+
15
+ var context = activity.Call<AndroidJavaObject> ("getApplicationContext");
16
+
17
+ var fileProvider = new AndroidJavaClass("android.support.v4.content.FileProvider");
18
+
19
+ var file = new AndroidJavaObject ("java.io.File", textureUrl);
20
+
21
+ uri = fileProvider.CallStatic<AndroidJavaObject>("getUriForFile", context, Application.identifier + ".fileprovider", file);
22
+
23
+ }
24
+
25
+ ```
26
+
27
+
28
+
29
+ 注目すべき点は、ファイルプロバイダに`android.support.v4.content.FileProvider`が指定されていることです。
30
+
31
+
32
+
33
+ compileSdkVersionが29の場合、`androidx.core.content.FileProvider`を使用する必要があるので、SocialConnectorプラグインは使用できません。
34
+
35
+
36
+
37
+ 解決方法(妥協案)としては、
38
+
39
+ * 他のプラグインを使用する
40
+
41
+ * compileSdkVersionを28にする(=AndroidXに対応しない)
42
+
43
+ * (ライセンスに問題がなければ)SocialConnectorプラグインを自分で改造する
44
+
45
+
46
+
47
+ といった方法があります。
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+ ---
56
+
57
+ ## 回答(旧版)
58
+
1
59
  AndroidManifest.xmlのproviderの記述を以下のよう変更にすると、解決するかもしれません。
2
60
 
3
61