Appstore提交审核prefs:root=Privacy 被拒的解决办法

  • Jason.z
  • 2019-01-17 05:06:15

问题描述

app被拒提示

Guideline 2.5.1 - Performance - Software Requirements Thank you for your resubmission. However, we noticed that the previous issue has not been resolved.  Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store. Next Steps To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL...

java通过反射R文件获取资源id

  • Jason.z
  • 2019-01-15 06:26:25

项目开发中,我们会经常使用到通过反射来获取资源id。

public static int getIdByName(Context context, String className, String name) { //className资源类型,name资源名称
        String packageName = context.getPackageName();
        Class r = null;
        int id = 0;

        try {
            r = Class.forName(packageName + ".R"); //拿到R文件Class文件
            Class[] classes = r.getClasses(); //返回类定义的公共的内部类,以及从父类、父接口那里继承来的内部类
            Class desireClass = null;

            Log.d("lololo", "getIdByName() returned: " +  Arrays.toString(classes));
            /**
             *  [class com.tencent.qcloud.timchat.R$styleable, class com.tencent.qcloud.timchat.R$style, class...

Tomcat 提示WEB-INF/lib/servlet-api.jar not loaded错误的解决办法

  • Jason.z
  • 2019-01-15 06:24:17

问题描述

启动tomcat后,控制台报错:

WEB-INF/lib/servlet-api.jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

问题分析

WEB-INF/lib跟tomcat的common/lib下的JAR包冲突。

问题解决

删除WEB-INF/lib下的servlet-api.jar即可。

Android Studio 提示aarch64-linux-android-strip file Missing错误的解决办法

  • Jason.z
  • 2019-01-15 06:20:32

问题描述

编译项目的时候,提示以下错误:

Error:org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip''

Error:net.rubygrapefruit.platform.NativeException: Could not start 'C:\Users...\AppData\Local\Android\sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-strip'

问题分析

貌似是ndk的关系

解决办法

1)升级ndk

2) 在build.gradle里添加

packagingOptions{
    doNotStrip '*/mips/*.so'
    doNotStrip '*/mips64/*.so'
}

Centos6通过yum安装gcc 4.8

  • Jason.z
  • 2019-01-10 01:39:40

不想使用源码升级的话 可以配置yum源进行升级

curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo
yum install gcc gcc-g++ -y

安装完成后查看版本:

[root@DS-VM-Node239 ~]# gcc --version
gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-8)
Copyright © 2013 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
[root@DS-VM-Node239 ~]# g++ --version
g++ (GCC) 4.8.2 20131212 (Red Hat 4.8.2-8)
Copyright © 2013 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。

npm安装的时候提示npm ERR! Error: CERT_NOT_YET_VALID错误的解决办法

  • Jason.z
  • 2019-01-09 05:54:52

问题描述

使用npm install安装模块的时候提示以下错误:

npm ERR! Error: CERT_NOT_YET_VALID npm ERR! at SecurePair. (tls.js:1370:32) npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17) npm ERR! at SecurePair.maybeInitFinished (tls.js:982:10) npm ERR! at CleartextStream.read [as _read] (tls.js:469:13) npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10) npm ERR! at EncryptedStream.write [as _write] (tls.js:366:25) npm ERR! at doWrite (_stream_writable.js:226:10) npm ERR! at writeOrBuffer (_stream_writable.js:216:5) npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11) npm ERR! at write (_stream_readable.js:583:24) npm ERR! If you need help, you may report this entire log, npm ERR!...

Xcode10 提示 library not found for -lstdc++ 的解决方法

  • Jason.z
  • 2019-01-02 02:26:50

问题描述

升级到xcode10,项目编译突然报错,提示:

library not found for -lstdc++.6.0.9 library not found for -lstdc++.6 library not found for...

xcode10提交到appstore的时候提示ERROR ITMS-90174: "Missing Provisioning Profile错误的解决办法

  • Jason.z
  • 2018-12-31 05:16:23

问题描述

使用xcode10 upload appstore的时候提示了以下错误:

ERROR ITMS-90174: "Missing Provisioning Profile - iOS Apps must contain a provisioning profile in a file named embedded.mobileprovision."

问题分析

可以参考cordova-ios相关issue, https://github.com/apache/cordova-ios/issues/407

解决办法

官方已经提供了3种解决办法

1、命令行使用参数--buildFlag='-UseModernBuildSystem=0'

ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

2、如果项目中使用build.json,可以修改其配置文件

"buildFlag": [
  "-UseModernBuildSystem=0"
]

3、修改xcode配置

1)打开xcode项目,在菜单栏中找到xcode-file-project settings

2) 在build system里选择...

使用ionic-plugin-deeplink插件微信/qq登录不回调的解决办法

  • Jason.z
  • 2018-12-29 10:44:03

使用ionic-plugin-deeplink插件后,发现qq登录和微信登录都不能使用,连接xcode调试后, 发现openurl方法被ionic-plugin-deeplink插件拦截了。

看了一下代码:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    IonicDeeplinkPlugin *plugin = [self.viewController getCommandInstance:PLUGIN_NAME];

    if(plugin == nil) {
      NSLog(@"Unable to get instance of command plugin");
      return NO;
    }

    BOOL handled = [plugin handleLink:url];

    if(!handled) {
      // Pass event through to Cordova
      [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];

      //...

ionic2-super-tabs不兼容rxjs6的解决办法

  • Jason.z
  • 2018-12-26 09:51:13

问题描述

项目报错:

core.js:12301 ERROR Error: Uncaught (in promise): TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.fromEvent is not a function TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.fromEvent is not a function at new SuperTabs (super-tabs.js:136)

问题分析

在github中找到了相关issue,应该是不兼容rx6的原因导致的,导致引入和写法有问题。

解决办法

修改node_modules\ionic2-super-tabs\dist\components\supertabs.js文件

修改

import { Observable } from 'rxjs/Observable';
 import 'rxjs/add/observable/fromEvent';

import { Observable, fromEvent } from 'rxjs';

修改

Observable.fromEvent(window, 'orientationchange'),
Observable.fromEvent(window, 'resize')

 fromEvent(window,...