我最近更改adMob 6.4.1为Google Play服务rev 15,刚刚收到我不明白的新崩溃报告的通知:
java.lang.SecurityException: attempting to read gservices without permission: Neither user 10158 nor current process has com.google.android.providers.gsf.permission.READ_GSERVICES.
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at xs.a(SourceFile:133)
at xo.a(SourceFile:133)
at xo.a(SourceFile:118)
at ud.d(SourceFile:88)
at ud.b(SourceFile:129)
at ua.a(SourceFile:239)
at ua.a(SourceFile:176)
at aas.a(SourceFile:118)
at abz.run(SourceFile:14)
at acb.run(SourceFile:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
Run Code Online (Sandbox Code Playgroud)
我做了一些研究,所有结果都已过时,或与Google+/Google地图相关,我在应用中都没有使用.
我从未在admob的GPS开发者指南中随处阅读,我需要添加
READ GSERVICES权限...
谁知道这是关于什么的?
这是我想出的算法的一部分:
\n\nfor (int i = 0; i < n - 1; i++)\n for (int j = i; j < n; j++)\n (...)\nRun Code Online (Sandbox Code Playgroud)\n\n我正在使用这个“双循环”来测试大小为 n 的数组中所有可能的 2 元素和。
\n\n显然(我必须同意它),这个“双循环”是O(n\xc2\xb2):
n + (n-1) + (n-2) + ... + 1 = sum from 1 to n = (n (n - 1))/2\nRun Code Online (Sandbox Code Playgroud)\n\n这是我感到困惑的地方:
\n\nfor (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n (...)\nRun Code Online (Sandbox Code Playgroud)\n\n当第二个“双循环”O(n\xc2\xb2)明显(在最坏的情况下)比第一个“双循环”好得多(?)时,其复杂度也为 …
我有2个静态方法,只有一个做了我想做的事情,我无法弄清楚另一个有什么问题.更具体地说,Method_A似乎不生成其参数的实例,并且在main中创建的同一变量上运行,而B似乎在实例上运行.
public static Method_A(Vector2[] in, int n)
{
for(int i = 0; i < in.Length; i++)
{
in[i].x = n;
in[i].y = n;
}
}
public static Method_B(Vector2 in, int n)
{
in.x = n;
in.y = n;
}
Run Code Online (Sandbox Code Playgroud)
然后从主要:
// This works, and changes values directly in "test"
Vector2[] test = meshFilter.uv;
Method_A(test, n);
meshFilter.uv = test;
// This FAILS, doesn't affect test
Vector2 test = meshFilter.uv[i];
Method_B(test, n);
meshFilter.uv[i] = test;
// This also FAILS, doesn't affect test …Run Code Online (Sandbox Code Playgroud) 在类型对象的方法中class A,我处理class B具有公共方法的对象.join(*A).
我希望我的类型对象A调用此someObjectOfTypeB.join(*A)方法,使用指向自身的指针作为参数.
void A::someMethod()
{
B b();
b.join(I want to a to use a pointer to itself as a parameter);
}
A a();
a.someMethod();
Run Code Online (Sandbox Code Playgroud)
经过进一步调查,this不是因为我引导自己相信的问题; 这确实是做我想做的事的正确方法.