代码之家  ›  专栏  ›  技术社区  ›  chillinOutMaxin

当部署到移动设备时,不会加载amazon s3中的资产

  •  0
  • chillinOutMaxin  · 技术社区  · 6 年前

    这是我第一次尝试使用amazon s3,我仍在学习。

    我不确定我是否需要在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"
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   chillinOutMaxin    6 年前

    好的,所以谢谢你dome12b。感谢你发布了如何让android调试器运行,我自己解决了它。在我开始这个项目的时候,我创建了统一到错误构建目标的资产包。我所要做的就是将资产包的构建目标改为android和presto,现在就可以了!。再次感谢你指引我正确的方向。