小编sab*_*nke的帖子

在实施Soomla Unity3d插件时进行购买时出现Google播放错误

我正在创建一个实现Soomla Unity IAP插件的应用程序.为了让IAP工作,我已经达到了可以在编辑器中进行购买的程度.(不是真正的购买,它只是更新用户可以在游戏中购买/消费的虚拟货币).

当我在Android设备上启动它时,我收到此错误:需要身份验证.您需要登录自己的Google帐户.

现在我已经阅读了多篇不同的文章,其中人们已经遇到过这个问题,似乎没有什么能帮助我.

这是我到目前为止所尝试的列表:

1)确保应用程序发布到alpha或beta进行测试.(现在在alpha中)

2)确保价格与游戏和开发者控制台相匹配.

3)使用以未使用开发人员电子邮件的用户身份登录的设备.

4)确保测试设备上的电子邮件在开发人员控制台中列为测试人员.

5)确保Android Manifest中列出了必要的权限.

6)确认商家帐户已正确设置并验证.

7)确保构建为发布而不是开发(不确定这是否重要,但我尝试了两种方式).

8)从项目中完全删除了所有Soomla插件,然后将其添加回来,同时非常仔细地遵循教程,以确保没有错过任何小的.仍然没有骰子.

我将核心和商店组件添加到他们必要的场景中.如果您对解决此问题应采取的措施有任何其他想法,请告诉我.同时,这是我用于设置Soomla的StoreAssets.cs代码:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Soomla.Store;

public class StoreAssets : IStoreAssets
{
    public static bool purchased = false;

    public int GetVersion()
    {
        return 0;
    }

    public void onItemPurchased(PurchasableVirtualItem pvi, string payload)
    {
        purchased = true;
    }

    public VirtualCurrency[] GetCurrencies() 
    {
        return new VirtualCurrency[]{TOKEN_CURRENCY};
    }

    public VirtualGood[] GetGoods() 
    {
        return new VirtualGood[] {BACKUP_FORCEFIELD, IMMUNITY, EMP, MULTIPLIER};
    }

    public VirtualCurrencyPack[] GetCurrencyPacks() 
    {
        return …
Run Code Online (Sandbox Code Playgroud)

c# android unity-game-engine in-app-purchase soomla

22
推荐指数
2
解决办法
1735
查看次数

实现Parse Unity插件的应用程序在Android设备上崩溃,但在编辑器中工作正常

我想在我的Unity游戏中使用Parse来实现高分.我的问题是,当我尝试将游戏放在我的Android设备上进行测试时,应用程序的名称会有所不同.它出现了"ParseUnityPushSample",即使除了添加Parse让我使用它的文件之外我没有改变任何东西.构建设置没有改变,它甚至显示我的包名称是相同的,但在设备上测试它有这个结果.

在Unity 5中测试它可以正常工作.游戏加载应该.这只有在我尝试将其放在设备上进行测试时才会发生.

随着它改变应用程序名称,它也会在打开时崩溃.当我尝试在Android设备上打开它时,我得到一个提示,说"ParseUnityPushSample"失败了.

编辑:

好的,所以我找到了一种方法来查看在设备上进行测试时发生的一些错误.我收到此错误:"无法在清单中找到统一活动.您需要确保将orientation属性设置为sensorLandscape手动.UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()"我不知道问题是什么,因为我手动设置了Android Manifest中sensorLandscape活动的方向.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.laserdeflector.sab" android:versionName="1.0.1" android:versionCode="1" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature" android:name="com.laserdeflector.sab.permission.C2D_MESSAGE" />
<uses-permission android:name="com.laserdeflector.sab.permission.C2D_MESSAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application android:label="Laser Deflector" android:icon="@drawable/app_icon" android:screenOrientation="sensorLandscape" android:name="com.soomla.SoomlaApp" android:debuggable="false" android:isGame="true">
<activity android:name=".UnityPlayerActivity">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
  </intent-filter>
</activity>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
  <intent-filter>
    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> …
Run Code Online (Sandbox Code Playgroud)

c# android unity-game-engine parse-platform unity5

14
推荐指数
1
解决办法
692
查看次数

仅在生产版本中的应用程序加载上的RuntimeException

我正在创建一个我正在创建的应用程序的问题.基本上,当你第一次尝试打开它时,应用程序会崩溃,之后它就会好起来.令人困惑的部分是它只在您从Google Play下载应用时才会发生.如果我直接从Android Studio在手机上加载应用程序,我不会收到任何错误.

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3290)
  at android.app.ActivityThread.-wrap20 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1715)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6682)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:380)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3285)
Run Code Online (Sandbox Code Playgroud)

在研究了这个问题后,我发现有人说要清除设备的缓存.这解决了这个问题......但是这只是擦除应用程序,从那时起它就可以正常工作了.初始安装仍然崩溃.这发生在多个设备上,但我无法在调试时重现它.我唯一的想法是,在调用setContentView()之后,我在onCreate()中有了这个代码.

Intent intent = new Intent(this, NotificationListener.class);
startService(intent);
bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
Run Code Online (Sandbox Code Playgroud)

NotificationListener.class扩展了NotificationListenerService.除了最初的发布,一切都很好.

UPDATE

以下是我在AndroidManifest中设置服务的方法:

<service android:name=".NotificationListener"
  android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
  <intent-filter>
      <action android:name="android.service.notification.NotificationListenerService" />
  </intent-filter>
</service>
Run Code Online (Sandbox Code Playgroud)

这是我的NotificationListenerService的简化版本:

public class NotificationListener extends NotificationListenerService
{
    private IBinder mBinder …
Run Code Online (Sandbox Code Playgroud)

java android android-service android-service-binding

6
推荐指数
1
解决办法
577
查看次数

旋转ImageView以面向纬度和经度的给定位置

我正在尝试编程我的应用程序,所以我的箭头ImageView将指向给定的android.Location.现在它没有指向正确的方向.由于某种原因它很漂亮.我认为这是因为我没有考虑到我正确面对的方向.

这是我目前正在做的事情:

float angle = GetAngle(myLocation);
RotateAnimation anim = new RotateAnimation(0.0f, angle, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(0);
anim.setDuration(2);
anim.setFillAfter(true);
arrow.startAnimation(anim);
Run Code Online (Sandbox Code Playgroud)

这是GetAngle()函数:

float GetAngle(Location myLocation)
{
    float angle = (float) Math.toDegrees(Math.atan2(theirLocation.getLatitude() - myLocation.getLatitude(), theirLocation.getLongitude() - myLocation.getLongitude()));
    if (angle < 0)
        angle += 360;
    return angle;
}
Run Code Online (Sandbox Code Playgroud)

有没有比我更好的方法呢?我不知道如何让ImageView面向我从一个位置给出的坐标.

java android location geolocation

5
推荐指数
1
解决办法
202
查看次数

远程访问 beaglebone blue

我正在做一个涉及 Beaglebone blue 的个人项目。我想从任何地方远程访问它。我不确定这样做的最佳方法是什么。我知道我可以只转发一个相应的端口(不安全)或类似的东西,但我想避免太多的安全漏洞。该板控制着我计划在 UI 中显示的相机,它还允许我四处移动相机。有很多公司拥有可以从任何地方控制的设备……那我该怎么做?

remote-access beagleboard

5
推荐指数
0
解决办法
103
查看次数

如何在调用paint()方法时避免重新初始化一维数组

我正在创建一个绘制多边形并填充它的程序.然后显示按钮,以便用户可以向上,向下,向左或向右移动多边形.现在,当我调用repaint()方法时,我遇到了一个问题.

在paint()方法中,我创建了一个包含绘制和填充多边形的方法的类的新实例.这就是我的问题的原因.每次调用paint()时都会创建一个新的类实例,因此我所拥有的包含多边形点坐标的数组将重置为其初始值.

我的问题是攻击这个问题的最佳方法是什么?如何在不创建新实例的情况下从paint()方法访问这些方法?我知道每个人都会说我可以使用像"NameOfClass.neededMethod();"这样的东西.这要求我把很多事情做成静态的,并且不会像希望的那样有效.

我很欣赏任何指针.

这是我的类的代码,它具有我需要访问的方法:

public class FillPolygon
{
    int left_most_edge, right_most_edge, scan = 0;
    double[] xcoord;
    double[][] table = new double[4][200];  //2d array containing: 
                                            //[0][-] -> ymax, [1][-] -> ymin, [2][-] -> dx, [3][-] -> x
    double[] px = {100, 150, 250, 300, 250, 150, 100}; //contains all x coord.
    double[] py = {125, 100, 200, 150, 100, 200, 200}; //contains all y coord.

    public void initializeTable()
    {
        int i, j;

        for (i = 0; i < 4; i++) …
Run Code Online (Sandbox Code Playgroud)

java graphics user-interface swing polygon

2
推荐指数
1
解决办法
75
查看次数