Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unity3d 部署到移动设备时,不会加载AmazonS3中的资产_Unity3d_Amazon S3_Augmented Reality_Vuforia - Fatal编程技术网

Unity3d 部署到移动设备时,不会加载AmazonS3中的资产

Unity3d 部署到移动设备时,不会加载AmazonS3中的资产,unity3d,amazon-s3,augmented-reality,vuforia,Unity3d,Amazon S3,Augmented Reality,Vuforia,这是我第一次尝试使用AmazonS3,我还在学习。 我正在尝试从AmazonS3加载一个简单AR应用程序的资产包。我使用Vuforia在相机观看特定图像时加载蜘蛛。这个资产在没有从amazon加载时工作得非常好,但是现在在我的手机上构建时,这个资产从来没有加载过,但是它确实在unity中加载过。我已经设置了权限,以便每个人都可以从资产包中读取 我不确定android SDK中是否有我需要做的事情 这是我用来从amazon s3加载资产的脚本: public Text debugText; //

这是我第一次尝试使用AmazonS3,我还在学习。 我正在尝试从AmazonS3加载一个简单AR应用程序的资产包。我使用Vuforia在相机观看特定图像时加载蜘蛛。这个资产在没有从amazon加载时工作得非常好,但是现在在我的手机上构建时,这个资产从来没有加载过,但是它确实在unity中加载过。我已经设置了权限,以便每个人都可以从资产包中读取

我不确定android SDK中是否有我需要做的事情

这是我用来从amazon s3加载资产的脚本:

public Text debugText;
// initialization
void Start()
{
    string url = "This is a url";
    WWW www = new WWW(url);
    StartCoroutine(WaitForReq(www));


}

IEnumerator WaitForReq(WWW www)
{
    yield return www;
    AssetBundle bundle = www.assetBundle;
    if (www.error == null)
    {
        GameObject SPIDER = (GameObject)bundle.LoadAsset("SPIDER");


        //For debugging, see if asset is being loaded
        debugText.text = ("Object has loaded");


        //Instantiates at the location of where the ImageTarget is
        var loadedAsset = Instantiate(SPIDER, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity); 
        //Makes transform of loadedAsset the transform of the ImageTarget 
        loadedAsset.transform.parent = gameObject.transform;
        loadedAsset.gameObject.active = false;
    }
    else
    {
        Debug.Log(www.error);
    }
}
编辑:添加日志

08-26 13:45:07.598: I/Unity(10633): StopVuforia
08-26 13:45:07.598: I/Unity(10633):  
08-26 13:45:07.598: I/Unity(10633): (Filename: 
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:45:46.320: W/UnityMain(10633): type=1400 audit(0.0:105566): avc: 
denied { read } for name="version" dev="proc" ino=4026532375 
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 
tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 
pgcomm="name.name"
08-26 13:45:46.403: I/Unity(10633): StartVuforia
08-26 13:45:46.403: I/Unity(10633):  
08-26 13:45:46.403: I/Unity(10633): (Filename: 
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:45:46.400: W/UnityMain(10633): type=1400 audit(0.0:105567): avc: 
denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=15357 
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0 
tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 
pgcomm="name.name"
08-26 13:46:19.877: I/Unity(10633): StopVuforia
08-26 13:46:19.877: I/Unity(10633):  
08-26 13:46:19.877: I/Unity(10633): (Filename: 
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:46:27.050: W/UnityMain(10633): type=1400 audit(0.0:105655): avc:         denied { read } for name="version" dev="proc" ino=4026532375 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 pgcomm="name.name"
08-26 13:46:27.089: I/Unity(10633): StartVuforia
08-26 13:46:27.089: I/Unity(10633):  
08-26 13:46:27.089: I/Unity(10633): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:46:27.080: W/UnityMain(10633): type=1400 audit(0.0:105656): avc: denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=15357 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0 tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 pgcomm="name.name"

好的,谢谢你。感谢你发布了如何让android调试器运行的帖子,我能够自己解决它。事实证明,早在我开始这个项目的时候,我就在unity中创建了资产包,指向错误的构建目标。我所要做的就是将资产包的构建目标更改为android和presto,现在就可以了!。再次感谢您为我指明了正确的方向。

您有日志记录吗?您可以连接到Unity设备并在其上运行场景:您可以在控制台中共享输出吗?我已经从android设备管理器添加了日志。顺便说一句,非常感谢你帮助我。我不知道那些日志,我花了一段时间才让它工作起来。