質問編集履歴
5
バージョンを変更した結果、上記のようなエラー内容に変わりました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -414,90 +414,44 @@
|
|
414
414
|
|
415
415
|
```エラー⑴
|
416
416
|
|
417
|
+
FormatException: Input string was not in a correct format.
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
エラー⑵
|
424
|
+
|
425
|
+
Error building Player: FormatException: Input string was not in a correct format.
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
エラー⑶
|
432
|
+
|
433
|
+
Build completed with a result of 'Failed'
|
434
|
+
|
435
|
+
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
エラー⑷
|
442
|
+
|
417
443
|
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
|
418
444
|
|
419
|
-
|
420
|
-
|
421
|
-
at UnityEditor.BuildPlayerWindow
|
445
|
+
|
446
|
+
|
447
|
+
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
|
422
452
|
|
423
453
|
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
424
454
|
|
425
455
|
|
426
456
|
|
427
|
-
エラー⑵
|
428
|
-
|
429
|
-
Multiple managers are loaded of type: InputManager
|
430
|
-
|
431
|
-
Multiple managers are loaded of type: GraphicsSettings
|
432
|
-
|
433
|
-
Multiple managers are loaded of type: PhysicsManager
|
434
|
-
|
435
|
-
Multiple managers are loaded of type: QualitySettings
|
436
|
-
|
437
|
-
Multiple managers are loaded of type: Physics2DSettings
|
438
|
-
|
439
|
-
Multiple managers are loaded of type: VFXManager
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
UnityEditor.AssetDatabase:SaveAssets()
|
444
|
-
|
445
|
-
Vuforia.EditorClasses.MigrateVuforiaConfigurationTask:Execute()
|
446
|
-
|
447
|
-
BuildObserver:MigrateVuforiaConfiguration()
|
448
|
-
|
449
|
-
BuildObserver:OnPreprocessBuild(BuildReport)
|
450
|
-
|
451
|
-
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
エラー⑶
|
456
|
-
|
457
|
-
Build completed with a result of 'Failed'
|
458
|
-
|
459
|
-
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
エラー⑷
|
464
|
-
|
465
|
-
Error building Player: 2 errors
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
白い吹き出し⑴
|
470
|
-
|
471
|
-
Cloud Anchor API key has not been set. Cloud Anchors will be disabled in this build.
|
472
|
-
|
473
|
-
UnityEngine.Debug:Log(Object)
|
474
|
-
|
475
|
-
GoogleARCoreInternal.CloudAnchorPreprocessBuild:_PreprocessAndroidBuild() (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:157)
|
476
|
-
|
477
|
-
GoogleARCoreInternal.CloudAnchorPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:41)
|
478
|
-
|
479
|
-
GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
|
480
|
-
|
481
|
-
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
白い吹き出し⑵
|
486
|
-
|
487
|
-
Building "AR Required" app. Use 'Edit > Project Settings > ARCore' to adjust ARCore settings.
|
488
|
-
|
489
|
-
See https://developers.google.com/ar/develop/unity/enable-arcore for more information.
|
490
|
-
|
491
|
-
UnityEngine.Debug:LogFormat(String, Object[])
|
492
|
-
|
493
|
-
GoogleARCoreInternal.RequiredOptionalPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/RequiredOptionalPreprocessBuild.cs:35)
|
494
|
-
|
495
|
-
GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
|
496
|
-
|
497
|
-
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
457
|
UnityでつくったゲームをAndroidStudioでビルドした際に上記のようなエラーが発生したのですがどのように解決したらよいですか?
|
4
白い吹き出しも追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -454,13 +454,7 @@
|
|
454
454
|
|
455
455
|
エラー⑶
|
456
456
|
|
457
|
-
UnityEditor.AssetDatabase:SaveAssets()
|
458
|
-
|
459
|
-
Vuforia.EditorClasses.MigrateVuforiaConfigurationTask:Execute()
|
460
|
-
|
461
|
-
Build
|
457
|
+
Build completed with a result of 'Failed'
|
462
|
-
|
463
|
-
BuildObserver:OnPreprocessBuild(BuildReport)
|
464
458
|
|
465
459
|
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
466
460
|
|
@@ -468,13 +462,41 @@
|
|
468
462
|
|
469
463
|
エラー⑷
|
470
464
|
|
465
|
+
Error building Player: 2 errors
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
白い吹き出し⑴
|
470
|
+
|
471
|
-
|
471
|
+
Cloud Anchor API key has not been set. Cloud Anchors will be disabled in this build.
|
472
|
+
|
473
|
+
UnityEngine.Debug:Log(Object)
|
474
|
+
|
475
|
+
GoogleARCoreInternal.CloudAnchorPreprocessBuild:_PreprocessAndroidBuild() (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:157)
|
476
|
+
|
477
|
+
GoogleARCoreInternal.CloudAnchorPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/CloudAnchorPreprocessBuild.cs:41)
|
478
|
+
|
479
|
+
GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
|
472
480
|
|
473
481
|
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
474
482
|
|
475
483
|
|
476
484
|
|
485
|
+
白い吹き出し⑵
|
486
|
+
|
487
|
+
Building "AR Required" app. Use 'Edit > Project Settings > ARCore' to adjust ARCore settings.
|
488
|
+
|
489
|
+
See https://developers.google.com/ar/develop/unity/enable-arcore for more information.
|
490
|
+
|
477
|
-
Err
|
491
|
+
UnityEngine.Debug:LogFormat(String, Object[])
|
492
|
+
|
493
|
+
GoogleARCoreInternal.RequiredOptionalPreprocessBuild:OnPreprocessBuild(BuildTarget, String) (at Assets/GoogleARCore/SDK/Scripts/Editor/RequiredOptionalPreprocessBuild.cs:35)
|
494
|
+
|
495
|
+
GoogleARCoreInternal.PreprocessBuildBase:OnPreprocessBuild(BuildReport) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52)
|
496
|
+
|
497
|
+
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
498
|
+
|
499
|
+
|
478
500
|
|
479
501
|
|
480
502
|
|
3
こちらが全エラーになります
test
CHANGED
File without changes
|
test
CHANGED
@@ -440,6 +440,18 @@
|
|
440
440
|
|
441
441
|
|
442
442
|
|
443
|
+
UnityEditor.AssetDatabase:SaveAssets()
|
444
|
+
|
445
|
+
Vuforia.EditorClasses.MigrateVuforiaConfigurationTask:Execute()
|
446
|
+
|
447
|
+
BuildObserver:MigrateVuforiaConfiguration()
|
448
|
+
|
449
|
+
BuildObserver:OnPreprocessBuild(BuildReport)
|
450
|
+
|
451
|
+
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
452
|
+
|
453
|
+
|
454
|
+
|
443
455
|
エラー⑶
|
444
456
|
|
445
457
|
UnityEditor.AssetDatabase:SaveAssets()
|
2
こちらが全てのエラー文になります。
test
CHANGED
File without changes
|
test
CHANGED
@@ -412,7 +412,9 @@
|
|
412
412
|
|
413
413
|
|
414
414
|
|
415
|
+
```エラー⑴
|
416
|
+
|
415
|
-
|
417
|
+
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
|
416
418
|
|
417
419
|
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
|
418
420
|
|
@@ -422,4 +424,46 @@
|
|
422
424
|
|
423
425
|
|
424
426
|
|
427
|
+
エラー⑵
|
428
|
+
|
429
|
+
Multiple managers are loaded of type: InputManager
|
430
|
+
|
431
|
+
Multiple managers are loaded of type: GraphicsSettings
|
432
|
+
|
433
|
+
Multiple managers are loaded of type: PhysicsManager
|
434
|
+
|
435
|
+
Multiple managers are loaded of type: QualitySettings
|
436
|
+
|
437
|
+
Multiple managers are loaded of type: Physics2DSettings
|
438
|
+
|
439
|
+
Multiple managers are loaded of type: VFXManager
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
エラー⑶
|
444
|
+
|
445
|
+
UnityEditor.AssetDatabase:SaveAssets()
|
446
|
+
|
447
|
+
Vuforia.EditorClasses.MigrateVuforiaConfigurationTask:Execute()
|
448
|
+
|
449
|
+
BuildObserver:MigrateVuforiaConfiguration()
|
450
|
+
|
451
|
+
BuildObserver:OnPreprocessBuild(BuildReport)
|
452
|
+
|
453
|
+
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
エラー⑷
|
458
|
+
|
459
|
+
Build completed with a result of 'Failed'
|
460
|
+
|
461
|
+
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
Error building Player: 2 errors
|
466
|
+
|
467
|
+
|
468
|
+
|
425
469
|
UnityでつくったゲームをAndroidStudioでビルドした際に上記のようなエラーが発生したのですがどのように解決したらよいですか?
|
1
ARcoreのサンプルコードに少し手を加えたものになります。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,418 @@
|
|
1
|
+
```C#
|
2
|
+
|
3
|
+
namespace GoogleARCore.Examples.HelloAR
|
4
|
+
|
5
|
+
{
|
6
|
+
|
7
|
+
using System.Collections.Generic;
|
8
|
+
|
9
|
+
using GoogleARCore;
|
10
|
+
|
11
|
+
using GoogleARCore.Examples.Common;
|
12
|
+
|
13
|
+
using UnityEngine;
|
14
|
+
|
15
|
+
using UnityEngine.EventSystems;
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
#if UNITY_EDITOR
|
20
|
+
|
21
|
+
// Set up touch input propagation while using Instant Preview in the editor.
|
22
|
+
|
23
|
+
using Input = InstantPreviewInput;
|
24
|
+
|
25
|
+
#endif
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
/// <summary>
|
30
|
+
|
31
|
+
/// Controls the HelloAR example.
|
32
|
+
|
33
|
+
/// </summary>
|
34
|
+
|
35
|
+
public class HelloARController : MonoBehaviour
|
36
|
+
|
37
|
+
{
|
38
|
+
|
39
|
+
/// <summary>
|
40
|
+
|
41
|
+
/// The first-person camera being used to render the passthrough camera image (i.e. AR
|
42
|
+
|
43
|
+
/// background).
|
44
|
+
|
45
|
+
/// </summary>
|
46
|
+
|
47
|
+
public Camera FirstPersonCamera;
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
/// <summary>
|
52
|
+
|
53
|
+
/// A prefab for tracking and visualizing detected planes.
|
54
|
+
|
55
|
+
/// </summary>
|
56
|
+
|
57
|
+
public GameObject DetectedPlanePrefab;
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
/// <summary>
|
62
|
+
|
63
|
+
/// A model to place when a raycast from a user touch hits a plane.
|
64
|
+
|
65
|
+
/// </summary>
|
66
|
+
|
67
|
+
public GameObject AndyPlanePrefab;
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
/// <summary>
|
72
|
+
|
73
|
+
/// A model to place when a raycast from a user touch hits a feature point.
|
74
|
+
|
75
|
+
/// </summary>
|
76
|
+
|
77
|
+
public GameObject AndyPointPrefab;
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
/// <summary>
|
82
|
+
|
83
|
+
/// The rotation in degrees need to apply to model when the Andy model is placed.
|
84
|
+
|
85
|
+
/// </summary>
|
86
|
+
|
87
|
+
private const float k_ModelRotation = 180.0f;
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
/// <summary>
|
92
|
+
|
93
|
+
/// True if the app is in the process of quitting due to an ARCore connection error,
|
94
|
+
|
95
|
+
/// otherwise false.
|
96
|
+
|
97
|
+
/// </summary>
|
98
|
+
|
99
|
+
private bool m_IsQuitting = false;
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
/// <summary>
|
104
|
+
|
105
|
+
/// The Unity Update() method.
|
106
|
+
|
107
|
+
/// </summary>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
private GameObject obj;
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
public void Start()
|
116
|
+
|
117
|
+
{
|
118
|
+
|
119
|
+
obj = GameObject.Find("sawara3");
|
120
|
+
|
121
|
+
obj.SetActive(false);
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
public void Update()
|
128
|
+
|
129
|
+
{
|
130
|
+
|
131
|
+
_UpdateApplicationLifecycle();
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
// If the player has not touched the screen, we are done with this update.
|
136
|
+
|
137
|
+
Touch touch;
|
138
|
+
|
139
|
+
if (Input.touchCount < 1 || (touch = Input.GetTouch(0)).phase != TouchPhase.Began)
|
140
|
+
|
141
|
+
{
|
142
|
+
|
143
|
+
return;
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
// Should not handle input if the player is pointing on UI.
|
150
|
+
|
151
|
+
if (EventSystem.current.IsPointerOverGameObject(touch.fingerId))
|
152
|
+
|
153
|
+
{
|
154
|
+
|
155
|
+
return;
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
// Raycast against the location the player touched to search for planes.
|
162
|
+
|
163
|
+
TrackableHit hit;
|
164
|
+
|
165
|
+
TrackableHitFlags raycastFilter = TrackableHitFlags.PlaneWithinPolygon |
|
166
|
+
|
167
|
+
TrackableHitFlags.FeaturePointWithSurfaceNormal;
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
if (Frame.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit))
|
172
|
+
|
173
|
+
{
|
174
|
+
|
175
|
+
// Use hit pose and camera pose to check if hittest is from the
|
176
|
+
|
177
|
+
// back of the plane, if it is, no need to create the anchor.
|
178
|
+
|
179
|
+
if ((hit.Trackable is DetectedPlane) &&
|
180
|
+
|
181
|
+
Vector3.Dot(FirstPersonCamera.transform.position - hit.Pose.position,
|
182
|
+
|
183
|
+
hit.Pose.rotation * Vector3.up) < 0)
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
Debug.Log("Hit at back of the current DetectedPlane");
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
else
|
192
|
+
|
193
|
+
{
|
194
|
+
|
195
|
+
// Choose the Andy model for the Trackable that got hit.
|
196
|
+
|
197
|
+
GameObject prefab;
|
198
|
+
|
199
|
+
if (hit.Trackable is FeaturePoint)
|
200
|
+
|
201
|
+
{
|
202
|
+
|
203
|
+
prefab = AndyPointPrefab;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
else
|
208
|
+
|
209
|
+
{
|
210
|
+
|
211
|
+
prefab = AndyPlanePrefab;
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
// Instantiate Andy model at the hit pose.
|
218
|
+
|
219
|
+
var andyObject = Instantiate(prefab, hit.Pose.position, hit.Pose.rotation);
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
// Compensate for the hitPose rotation facing away from the raycast (i.e.
|
224
|
+
|
225
|
+
// camera).
|
226
|
+
|
227
|
+
obj.transform.Rotate(0, k_ModelRotation, 0, Space.Self);
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
// Create an anchor to allow ARCore to track the hitpoint as understanding of
|
232
|
+
|
233
|
+
// the physical world evolves.
|
234
|
+
|
235
|
+
var anchor = hit.Trackable.CreateAnchor(hit.Pose);
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
obj.SetActive(true);
|
240
|
+
|
241
|
+
obj.transform.position = hit.Pose.position;
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
// Make Andy model a child of the anchor.
|
246
|
+
|
247
|
+
andyObject.transform.parent = anchor.transform;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
/// <summary>
|
258
|
+
|
259
|
+
/// Check and update the application lifecycle.
|
260
|
+
|
261
|
+
/// </summary>
|
262
|
+
|
263
|
+
private void _UpdateApplicationLifecycle()
|
264
|
+
|
265
|
+
{
|
266
|
+
|
267
|
+
// Exit the app when the 'back' button is pressed.
|
268
|
+
|
269
|
+
if (Input.GetKey(KeyCode.Escape))
|
270
|
+
|
271
|
+
{
|
272
|
+
|
273
|
+
Application.Quit();
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
// Only allow the screen to sleep when not tracking.
|
280
|
+
|
281
|
+
if (Session.Status != SessionStatus.Tracking)
|
282
|
+
|
283
|
+
{
|
284
|
+
|
285
|
+
const int lostTrackingSleepTimeout = 15;
|
286
|
+
|
287
|
+
Screen.sleepTimeout = lostTrackingSleepTimeout;
|
288
|
+
|
289
|
+
}
|
290
|
+
|
291
|
+
else
|
292
|
+
|
293
|
+
{
|
294
|
+
|
295
|
+
Screen.sleepTimeout = SleepTimeout.NeverSleep;
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
if (m_IsQuitting)
|
302
|
+
|
303
|
+
{
|
304
|
+
|
305
|
+
return;
|
306
|
+
|
307
|
+
}
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
// Quit if ARCore was unable to connect and give Unity some time for the toast to
|
312
|
+
|
313
|
+
// appear.
|
314
|
+
|
315
|
+
if (Session.Status == SessionStatus.ErrorPermissionNotGranted)
|
316
|
+
|
317
|
+
{
|
318
|
+
|
319
|
+
_ShowAndroidToastMessage("Camera permission is needed to run this application.");
|
320
|
+
|
321
|
+
m_IsQuitting = true;
|
322
|
+
|
323
|
+
Invoke("_DoQuit", 0.5f);
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
else if (Session.Status.IsError())
|
328
|
+
|
329
|
+
{
|
330
|
+
|
331
|
+
_ShowAndroidToastMessage(
|
332
|
+
|
333
|
+
"ARCore encountered a problem connecting. Please start the app again.");
|
334
|
+
|
335
|
+
m_IsQuitting = true;
|
336
|
+
|
337
|
+
Invoke("_DoQuit", 0.5f);
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
/// <summary>
|
350
|
+
|
351
|
+
/// Actually quit the application.
|
352
|
+
|
353
|
+
/// </summary>
|
354
|
+
|
355
|
+
private void _DoQuit()
|
356
|
+
|
357
|
+
{
|
358
|
+
|
359
|
+
Application.Quit();
|
360
|
+
|
361
|
+
}
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
/// <summary>
|
366
|
+
|
367
|
+
/// Show an Android toast message.
|
368
|
+
|
369
|
+
/// </summary>
|
370
|
+
|
371
|
+
/// <param name="message">Message string to show in the toast.</param>
|
372
|
+
|
373
|
+
private void _ShowAndroidToastMessage(string message)
|
374
|
+
|
375
|
+
{
|
376
|
+
|
377
|
+
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
|
378
|
+
|
379
|
+
AndroidJavaObject unityActivity =
|
380
|
+
|
381
|
+
unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
if (unityActivity != null)
|
386
|
+
|
387
|
+
{
|
388
|
+
|
389
|
+
AndroidJavaClass toastClass = new AndroidJavaClass("android.widget.Toast");
|
390
|
+
|
391
|
+
unityActivity.Call("runOnUiThread", new AndroidJavaRunnable(() =>
|
392
|
+
|
393
|
+
{
|
394
|
+
|
395
|
+
AndroidJavaObject toastObject =
|
396
|
+
|
397
|
+
toastClass.CallStatic<AndroidJavaObject>(
|
398
|
+
|
399
|
+
"makeText", unityActivity, message, 0);
|
400
|
+
|
401
|
+
toastObject.Call("show");
|
402
|
+
|
403
|
+
}));
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
}
|
408
|
+
|
409
|
+
}
|
410
|
+
|
411
|
+
}
|
412
|
+
|
413
|
+
|
414
|
+
|
1
|
-
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
|
415
|
+
```UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
|
2
416
|
|
3
417
|
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
|
4
418
|
|