defalut activity not found

1.manifest文件中的路径配置没问题

2.intent-filiter 配置没问题

3.Launch option 设置nothing不是解决方案

注:这种方法可以安装,但是不能进行debug

4.file -> invalide Catch 不是解决方案

5.activity注册时填写完整路径不是解决方案

球球各位救救孩子吧,已经疯了两天了

1个回答

自我解决,回退AS版本至3.0.1 完美解决

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
AS 运行时出现Error Default Activity not found

完全按照《第一行代码 第二版》中的内容进行操作,可进行到第36页时就无法运行。 明明已经写好了一个有界面的程序,可就是不能运行。如果在app选项卡里将Launch Options 的 Default Activity改为Nothing的话,的确不报错了,也能运行了,但编写的界面也没了。

Android studio 运行一个壁纸程序提示Default Activity not foun

![图片说明](https://img-ask.csdn.net/upload/201704/09/1491725916_872001.png) 导入了一个壁纸程序结果无法运行提示Default Activity not foun,网上搜了很多还是找不到解决办法

android libGDX 错误信息

开发的游戏在笔记本中运行,但是到了android上后log出现如下信息: 04-01 21:50:10.314: D/ActivityThread(21047): setTargetHeapConcurrentStart:2097152 04-01 21:50:10.334: D/dalvikvm(21047): Trying to load lib /data/data/com.vulcanic.flickit/lib/libgdx.so 0x41e53a48 04-01 21:50:10.334: D/dalvikvm(21047): Added shared lib /data/data/com.vulcanic.flickit/lib/libgdx.so 0x41e53a48 04-01 21:50:10.334: D/dalvikvm(21047): No JNI_OnLoad found in /data/data/com.vulcanic.flickit/lib/libgdx.so 0x41e53a48, skipping init 04-01 21:50:10.344: D/libEGL(21047): loaded /system/lib/egl/libEGL_adreno200.so 04-01 21:50:10.344: D/libEGL(21047): loaded /system/lib/egl/libGLESv1_CM_adreno200.so 04-01 21:50:10.354: D/libEGL(21047): loaded /system/lib/egl/libGLESv2_adreno200.so 04-01 21:50:10.364: I/Adreno200-EGL(21047): <qeglDrvAPI_eglInitialize:269>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_REL_RB4.04.01.02.16.049_msm8960_JB_REL_RB4.2_Merge_release_AU (Merge) 04-01 21:50:10.364: I/Adreno200-EGL(21047): Build Date: 12/12/12 Wed 04-01 21:50:10.364: I/Adreno200-EGL(21047): Local Branch: 04-01 21:50:10.364: I/Adreno200-EGL(21047): Remote Branch: m/jb_rel_rb4.2 04-01 21:50:10.364: I/Adreno200-EGL(21047): Local Patches: NONE 04-01 21:50:10.364: I/Adreno200-EGL(21047): Reconstruct Branch: AU_LINUX_ANDROID_JB_REL_RB4.04.01.02.16.049 + NOTHING android工程的目录中有`armeabi`和`armeabi-v7a`。 使用的版本是IntelliJ IDEA 12.0.4。

Android studio开发过程中遇到的问题

Android studio读取文件绘制曲线图时出现如下警告,数据无法显示,只有外框 ![图片说明](https://img-ask.csdn.net/upload/202006/01/1590978715_231188.png) ![图片说明](https://img-ask.csdn.net/upload/202006/01/1590978730_504536.png) 麻烦大佬帮忙解决,谢谢了

小米智能家庭插件开发,找不到默认activity

Could not identify launch activity: Default Activity not found Error while Launching activity ![图片说明](https://img-ask.csdn.net/upload/201605/30/1464587270_662375.png) 小米智能家庭插件开发中出现的问题,找不到activity,求大神解答

关于activity工作流的集成问题!!!

配置文件如下: ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd" default-autowire="byName"> <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <property name="dataSource" ref="dataSource"/> <property name="transactionManager" ref="jdbcTransactionManager"/> <property name="databaseSchemaUpdate" value="true"/> <property name="jobExecutorActivate" value="false"/> <property name="history" value="full"/> <property name="dbIdentityUsed" value="false"/> <!-- 生成流程图的字体 --> <property name="activityFontName" value="宋体"/> <property name="labelFontName" value="宋体"/> </bean> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <property name="processEngineConfiguration" ref="processEngineConfiguration"/> </bean> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/> <bean id="formService" factory-bean="processEngine" factory-method="getFormService"/> <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"/> <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/> <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/> <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/> </beans> ``` 错误信息如下: 2016-12-15 20:54:50[org.quartz.core.QuartzScheduler][QuartzScheduler.java.setJobFactory():2075]- JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@9a57324 十二月 15, 2016 8:54:54 下午 org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl initDatabaseType 严重: Exception while initializing Database connection org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-176] at org.h2.message.DbException.getJdbcSQLException(DbException.java:344) at org.h2.message.DbException.get(DbException.java:167) at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:434) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:311) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91) at org.h2.Driver.connect(Driver.java:74) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:187) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:201) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:196) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:93) at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:385) at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:89) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:835) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:786) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:602) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:590) at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1440) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1054) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) 不知道为什么会报错,我练的是oracle数据库,报的错误确是H2数据库错误, 配置文件都没问题啊,不知道为什么会报错啊

appium测试微信公众号出现Could not find package com.android.chrome on the device的问题

1.新手,想在微信上面测试公众号,用的是appium+java,写了测试用例然后run的时候一直报错,没有找到解决方案,求大神指点,在线等!! 2.以下是我的代码: 初始化init类: ``` package appiumDemo; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.android.AndroidDriver; public class InitAppium { public static AndroidDriver launchApp(String deviceName) throws MalformedURLException { // 设置自动化相关参数 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); // 使用哪种移动平台 capabilities.setCapability("platformName", "Android"); // 启动哪种设备,是真机还是模拟器 capabilities.setCapability("deviceName", deviceName); // 如果是模拟器输入Android Emulator 红米note3 db3489d // 不要再次安装apk capabilities.setCapability("noReset", true); // 不用重新签名 capabilities.setCapability("noSign", true); // 设置安卓系统版本 capabilities.setCapability("platformVersion", "7.1"); // 支持unicode键盘,输入中文设置 capabilities.setCapability("unicodeKeyboard", "True"); capabilities.setCapability("resetKeyboard", "True"); // 设置app的主包名和主类名 capabilities.setCapability("appPackage","com.tencent.mm"); capabilities.setCapability("appActivity", "com.tencent.mm.ui.LauncherUI"); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("androidProcess", "com.tencent.mm:tools"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); AndroidDriver driver = new AndroidDriver(new URL("http://169.254.82.105:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); return driver; } } ``` 测试类代码如下: ``` package appiumDemo; import java.net.MalformedURLException; import org.testng.annotations.Test; import io.appium.java_client.android.AndroidDriver; public class NewTest { private AndroidDriver driver; @SuppressWarnings("static-access") @Test public void f() { InitAppium init=new InitAppium(); try { init.launchApp("c353ce90"); } catch (MalformedURLException e) { e.printStackTrace(); } driver.findElementById("com.tencent.mm:id/azj").click(); } } ``` 3.报错信息 ``` [RemoteTestNG] failed to get TestNG version from class: java.lang.ClassNotFoundException: org.testng.internal.Version [RemoteTestNG] now trying to parse the version from pom.properties [RemoteTestNG] parsing TestNG version at jar:file:/E:/test/Tools/maven/maven-repository/org/testng/testng/6.1.1/testng-6.1.1.jar!/META-INF/maven/org.testng/testng/pom.properties [RemoteTestNG] detected TestNG version 6.1.1 [TestNG] Running: C:\Users\vanchu\AppData\Local\Temp\testng-eclipse-1879104749\testng-customsuite.xml FAILED: f org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find package com.android.chrome on the device (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 9.90 seconds Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z' System info: host: 'DESKTOP-GBO4D78', ip: '169.254.151.82', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_91' Driver info: driver.version: AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:87) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:111) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72) at appiumDemo.InitAppium.launchApp(InitAppium.java:54) at appiumDemo.NewTest.f(NewTest.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1178) at org.testng.TestRunner.privateRun(TestRunner.java:757) at org.testng.TestRunner.run(TestRunner.java:608) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158) at org.testng.TestNG.runSuitesLocally(TestNG.java:1083) at org.testng.TestNG.run(TestNG.java:999) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) =============================================== Default test Tests run: 1, Failures: 1, Skips: 0 =============================================== =============================================== Default suite Total tests run: 1, Failures: 1, Skips: 0 =============================================== [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@6e6d5e: 1485 ms [TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 296 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@1f256fa: 109 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter@aa5eb0: 62 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1ebec15: 8 ms ```

Jboss启动项目报错 以下是错误信息:

13:34:38,808 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015893: Encountered invalid class name 'extensionClasses=org.codehaus.groovy.jsr223.ScriptExtensions,org.codehaus.groovy.runtime.NioGroovyMethods,org.codehaus.groovy.runtime.SqlGroovyMethods,org.codehaus.groovy.runtime.SwingGroovyMethods,org.codehaus.groovy.runtime.XmlGroovyMethods' for service type 'org.codehaus.groovy.runtime.ExtensionModule' 13:34:38,808 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015893: Encountered invalid class name 'staticExtensionClasses=org.codehaus.groovy.jsr223.ScriptStaticExtensions' for service type 'org.codehaus.groovy.runtime.ExtensionModule' 13:34:39,098 WARN [org.jboss.as.ee] (MSC service thread 1-15) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.http.server.ServletServerHttpAsyncRequestControl at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final] at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79] 13:34:39,100 WARN [org.jboss.as.ee] (MSC service thread 1-15) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final] at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79] 13:34:39,155 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 13:34:39,185 INFO [org.jboss.web] (ServerService Thread Pool -- 74) JBAS018210: Register web context: /test.activity 13:34:39,193 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/test.activity]] (ServerService Thread Pool -- 74) No Spring WebApplicationInitializer types detected on classpath 13:34:39,664 WARNING [org.apache.myfaces.webapp.AbstractFacesInitializer] (ServerService Thread Pool -- 74) No mappings of FacesServlet found. Abort initializing MyFaces. 谢谢诸位.

android studio引入github第三方工程出现assembleRelease无法识别

apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { applicationId "cn.feng.skin.demo" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile project(':android-skin-loader-lib') } final def TARGET_SKIN_DIR = '../skin-package/' final def SAMPLE_NAME = 'Sample.apk' assembleRelease.doLast { println("=====================assembleRelease.doLast.begin.=========================") def dir = new File(TARGET_SKIN_DIR) if (!dir.exists()) { dir.mkdirs() } def f = new File(TARGET_SKIN_DIR + SAMPLE_NAME) if (f.exists()) { f.delete() } copy { from('build/outputs/apk') into(TARGET_SKIN_DIR) include '*.apk' exclude '**/*-unaligned.apk' rename ('android-skin-loader-sample-release.apk', SAMPLE_NAME) } println("=====================assembleRelease.doLast success.=========================") } assembleDebug.doLast { println("=====================assembleDebug.doLast.begin.=========================") def dir = new File(TARGET_SKIN_DIR) if (!dir.exists()) { dir.mkdirs() } def f = new File(TARGET_SKIN_DIR + SAMPLE_NAME) if (f.exists()) { f.delete() } copy { from('build/outputs/apk') into(TARGET_SKIN_DIR) include '*.apk' exclude '**/*-unaligned.apk' rename ('android-skin-loader-sample-debug.apk', SAMPLE_NAME) } println("=====================assembleDebug.doLast success.=========================") } Error:(32, 0) Could not get unknown property 'assembleRelease' for project ':android-skin-loader-sample' of type org.gradle.api.Project.

关于用代买生成K2 kprx 文件

我想在想要用代码来生成K2 KPRX 文件 , 现在的问题是文件已经生成成功,也能够通过代码发布,但是一旦发起流程 ,K2 就会报错 , 错误信息是:Key could not be found in the collection 。 代码如下 : 想请教下高手怎么解决这个问题, 我现在是不知道哪里写错了 。 enter code here #region 设置节点审核界面 ClientEvent approvalClientEvent = WorkflowFactory.CreateEvent<ClientEvent>(node.ApprovalNode_Name, WizardNames.DefaultClientEvent); approvalClientEvent.EventItem.InternetPlatform = "ASP"; approvalClientEvent.EventItem.SendToInternet = true; ////需要绑定smartobject作为审核界面来源 SmartObjectFieldPart smfp = new SmartObjectFieldPart(); //#region 创建locals Local localSmart = new Local("Name", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.SmartObjectName))); smfp.Properties.Locals.Add("Name", localSmart); EnvironmentFieldModel environment = new EnvironmentFieldModel("SmartObject Server", ""); ArtifactLibraryFieldPart fieldPart = new ArtifactLibraryFieldPart(environment); Local localServer = new Local("Server", K2FieldFactory.CreateK2Field(typeof(string), fieldPart)); smfp.Properties.Locals.Add("Server", localServer); Local localMothed = new Local("MethodDisplayName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.FormUrl))); smfp.Properties.Locals.Add("MethodDisplayName", localMothed); Local localMothedType = new Local("MethodType", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart("read"))); smfp.Properties.Locals.Add("MethodType", localMothedType); Local localDisplayName = new Local("DisplayName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.SmartObjectName))); smfp.Properties.Locals.Add("DisplayName", localDisplayName); //Local localIsList = new Local("IsList", K2FieldFactory.CreateK2Field(typeof(bool), new ValueTypePart("False"))); //smfp.Properties.Locals.Add("IsList", localIsList); Local localGuid = new Local("Guid", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Guid.NewGuid().ToString()))); smfp.Properties.Locals.Add("Guid", localGuid); Local localMethodName = new Local("MethodName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.FormUrl))); smfp.Properties.Locals.Add("MethodName", localMethodName); Local localType = new Local("Type", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart("SourceCode.SmartFunctions.Syntax.Expressions.SmartObjectExp"))); smfp.Properties.Locals.Add("Type", localType); #endregion #region 创建inputs Input inputProId = new Input("procId", "procId", "Text", true, K2FieldFactory.CreateK2Field(typeof(string), new DataFieldPart("Process", "RequestID", DataTypes.String, FieldListOption.None))); smfp.Properties.Inputs.Add("procId", inputProId); Input inputActivityName = new Input("activityName", "activityName", "Text", true, K2FieldFactory.CreateK2Field(typeof(string), new WorkflowContextFieldPart(WorkflowContextProperty.ActivityInstanceName))); smfp.Properties.Inputs.Add("activityName", inputActivityName); #endregion #region 创建returns Return returnResult = new Return("result"); returnResult.DisplayName = "result"; returnResult.IsSelected = true; returnResult.Type = "Text"; smfp.Properties.Returns.Add("result", returnResult); #endregion #region 创建properties Property pResult = new Property(); pResult.Name = "result"; pResult.DisplayName = "result"; pResult.Type = "Text"; smfp.Properties.Properties.Add("result", pResult); #endregion #region SourceCode.Workflow.Authoring.K2Field interPart = new K2Field(); interPart.Parts.Add(smfp); interPart.Parts.Add(new ValueTypePart("&")); interPart.Parts.Add(new SerialNoFieldPart()); approvalClientEvent.EventItem.InternetUrl = interPart; approvalClientEvent.EventItem.InternetUrl = K2FieldFactory.CreateK2Field( typeof(string), new ValueTypePart("http://webserver/page.aspx?"), new SerialNoFieldPart()); activity.Events.Add(approvalClientEvent); #endregion #region 设置节点审核人 //如何通过smartobject设置审核人 SimpleDestinationRule destinationRule = new SimpleDestinationRule(); DestinationSet defaultDestinationSet = new DestinationSet(); Destination destination = new Destination(); destination.Type = DestinationTypes.User; SmartObjectFieldPart smfpDestination = new SmartObjectFieldPart(); //smfpDestination.SmartObjectGuid = smartobject.Guid; #region 创建locals Local localSmartDestination = new Local("Name", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.SmartObjectName))); smfpDestination.Properties.Locals.Add("Name", localSmartDestination); EnvironmentFieldModel environmentDestination = new EnvironmentFieldModel("SmartObject Server", ""); ArtifactLibraryFieldPart fieldPartDestination = new ArtifactLibraryFieldPart(environmentDestination); Local localServerDestination = new Local("Server", K2FieldFactory.CreateK2Field(typeof(string), fieldPartDestination)); smfpDestination.Properties.Locals.Add("Server", localServerDestination); Local localMothedDestination = new Local("MethodDisplayName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.GetApproveUserNames))); smfpDestination.Properties.Locals.Add("MethodDisplayName", localMothedDestination); Local localMothedTypeDestination = new Local("MethodType", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart("list"))); smfpDestination.Properties.Locals.Add("MethodType", localMothedTypeDestination); Local localDisplayNameDestination = new Local("DisplayName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.SmartObjectName))); smfpDestination.Properties.Locals.Add("DisplayName", localDisplayNameDestination); smfpDestination.Properties.Locals["IsList"].Value = K2FieldFactory.CreateK2Field(typeof(bool), new ValueTypePart("False")); Local localGuidDestination = new Local("Guid", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Guid.NewGuid().ToString()))); smfpDestination.Properties.Locals.Add("Guid", localGuidDestination); Local localMethodNameDestination = new Local("MethodName", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart(Config.GetApproveUserNames))); smfpDestination.Properties.Locals.Add("MethodName", localMethodNameDestination); Local localTypeDestination = new Local("Type", K2FieldFactory.CreateK2Field(typeof(string), new ValueTypePart("SourceCode.SmartFunctions.Syntax.Expressions.SmartObjectExp"))); smfpDestination.Properties.Locals.Add("Type", localTypeDestination); #endregion #region 创建inputs Input inputProIdDestination = new Input("procId", "procId", "Text", true, K2FieldFactory.CreateK2Field(typeof(string), new DataFieldPart("Process", "RequestID", DataTypes.String, FieldListOption.None))); smfpDestination.Properties.Inputs.Add("procId", inputProIdDestination); Input inputActivityNameDestination = new Input("activityName", "activityName", "Text", true, K2FieldFactory.CreateK2Field(typeof(string), new WorkflowContextFieldPart(WorkflowContextProperty.ActivityInstanceName))); smfpDestination.Properties.Inputs.Add("activityName", inputActivityNameDestination); #endregion #region 创建returns Return returnResultDestination = new Return("result"); returnResultDestination.DisplayName = "result"; returnResultDestination.IsSelected = true; returnResultDestination.Type = "Text"; smfpDestination.Properties.Returns.Add("result", returnResultDestination); #endregion #region 创建properties Property pResultDestination = new Property(); pResultDestination.Name = "result"; pResultDestination.DisplayName = "result"; pResultDestination.Type = "Text"; smfpDestination.Properties.Properties.Add("result", pResultDestination); #endregion SourceCode.Workflow.Authoring.K2Field destinationField = new K2Field(); destinationField.Parts.Add(smfpDestination); destination.Value = destinationField; defaultDestinationSet.Destinations.Add(destination); destinationRule.DestinationSets.Add(defaultDestinationSet); // Set the destination rule of the activity activity.DestinationRule = destinationRule; #endregion #region 设置节点上的动作 var lines = BllRulInfo.Fetch(new CriteriaRulInfo { EqStartActId = node.ID }); foreach (var line in lines) { if (!string.IsNullOrEmpty(line.RulAct)) { EventAction action = WorkflowFactory.CreateK2Object<EventAction>(line.RulAct); action.Description = line.Id; action.ActionItem = new DefaultOutcomeAction(); approvalClientEvent.Actions.Add(action); } } #endregion #region 设置节点上的规则导航 //相同动作不同规则如何设置 activity.SucceedingRule = new DefaultOutcomeSucceedingRule(); PropertyWizardDefinition propWizDefSimple = WorkflowHelpers.FindOfType<SimpleSucceedingRulePropertyWizardDefinition>(activity.WizardDefinition.PropertyWizardDefinitions); PropertyWizardDefinition propWizDefOutcome = WorkflowHelpers.FindOfType<OutcomeSucceedingRulePropertyWizardDefinition>(activity.WizardDefinition.PropertyWizardDefinitions); if (propWizDefSimple != null && propWizDefOutcome == null) { activity.WizardDefinition.PropertyWizardDefinitions.Remove(propWizDefSimple); activity.WizardDefinition.PropertyWizardDefinitions.Add( WorkflowFactory.CreatePropertyWizardDefinition(PropertyWizardNames.OutcomeSucceedingRule)); } #endregion #region 设置节点上的动作对应的outcome //如何生成一个动作对应多个outcome //SourceCode.Workflow.Design.Outcome.Common.GenerateDefaultOutcomesForActions(approvalClientEvent); ProcessFactory.GenerateDefaultOutcomesForActions(approvalClientEvent, lines); #endregion #region 设置节点上的outcome对应的line SourceCode.Workflow.Design.Outcome.Common.GenerateDefaultLinesForOutcomes(activity.SucceedingRule as DefaultOutcomeSucceedingRule); foreach (var line in lines) { if (!string.IsNullOrEmpty(line.RulAct)) { DefaultActivity finishActivity = FindActivity(process, nodeNameDic[line.EndActId]); Line pl = FindLine(process, node.ApprovalNode_Name, line.RulAct); if (pl != null) pl.FinishActivity = finishActivity; } } #endregion

Appium+Python爬虫无法启动APP

非计算机专业,初学python和appium,需要抓取小红书APP的数据,连接夜神模拟器,但是无法启动APP,一直报错找不到原因,下面放上appium工作日志希望各路大神可以帮帮忙。谢谢大家! ``` [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","deviceName":"127.0.0.1:62025","appPackage":"com.xingin.xhs","platformVersion":"5.1.1","appActivity":".activity.SplashActivity","noReset":true,"unicodeKeyboard":true},null,{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:62025","appium:appPackage":"com.xingin.xhs","appium:platformVersion":"5.1.1","appium:appActivity":".activity.SplashActivity","appium:noReset":true,"appium:unicodeKeyboard":true}]}] [BaseDriver] Event 'newSessionRequested' logged at 1553679403156 (17:36:43 GMT+0800 (中国标准时间)) [Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for Android sessions. [Appium] Setting automation to 'UiAutomator1'. [Appium] Creating new AndroidDriver (v4.8.0) session [Appium] Capabilities: [Appium] platformName: Android [Appium] deviceName: 127.0.0.1:62025 [Appium] appPackage: com.xingin.xhs [Appium] platformVersion: 5.1.1 [Appium] appActivity: .activity.SplashActivity [Appium] noReset: true [Appium] unicodeKeyboard: true [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"platformName":"Android","... were provided [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [BaseDriver] Session created with session id: 4aa3fc42-b895-499c-b714-aaaf47854f3a [AndroidDriver] Java version is: 1.8.0_201 [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices... [ADB] 1 device(s) connected [AndroidDriver] Looking for a device with Android '5.1.1' [ADB] Setting device id to 127.0.0.1:62001 [ADB] Getting device platform version [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 5.1.1 [AndroidDriver] Using device: 127.0.0.1:62001 [ADB] Setting device id to 127.0.0.1:62001 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.sdk' [ADB] Current device property 'ro.build.version.sdk': 22 [ADB] Device API level: 22 [AndroidDriver] App file was not listed, instead we're going to run com.xingin.xhs directly on the device [AndroidDriver] Checking whether package is present on the device [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell pm list packages com.xingin.xhs' [AndroidDriver] Starting Android session [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 wait-for-device' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell echo ping' [AndroidDriver] Pushing settings apk to device... [ADB] Getting install status for io.appium.settings [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell dumpsys package io.appium.settings' [ADB] 'io.appium.settings' is not installed [ADB] App 'C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' is not installed [ADB] Installing 'C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [ADB] Skipping permissions grant option, since the current API level 22 does not support applications permissions customization [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 install C\:\\Users\\zlp\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\io.appium.settings\\apks\\settings_apk-debug.apk' [ADB] Install command stdout: pkg: /data/local/tmp/settings_apk-debug.apk [ADB] Success [ADB] Getting IDs of all 'io.appium.settings' processes [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell 'pgrep --help; echo $?'' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell 'pidof --help > /dev/null; echo $?'' [ADB] Using ps-based PID detection [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ps' [AndroidDriver] Granting android.permission.SET_ANIMATION_SCALE, CHANGE_CONFIGURATION, ACCESS_FINE_LOCATION by pm grant [ADB] Granting permissions ["android.permission.SET_ANIMATION_SCALE","android.permission.CHANGE_CONFIGURATION","android.permission.ACCESS_FINE_LOCATION"] to 'io.appium.settings' [ADB] Got the following command chunks to execute: [["pm","grant","io.appium.settings","android.permission.SET_ANIMATION_SCALE",";","pm","grant","io.appium.settings","android.permission.CHANGE_CONFIGURATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_FINE_LOCATION",";"]] [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell pm grant io.appium.settings android.permission.SET_ANIMATION_SCALE \; pm grant io.appium.settings android.permission.CHANGE_CONFIGURATION \; pm grant io.appium.settings android.permission.ACCESS_FINE_LOCATION \;' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell settings put secure mock_location 1' [Logcat] Starting logcat capture [AndroidDriver] Enabling Unicode keyboard support [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell settings get secure default_input_method' [AndroidDriver] Unsetting previous IME com.android.inputservice/.InputService [AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ime enable io.appium.settings/.UnicodeIME' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ime set io.appium.settings/.UnicodeIME' [ADB] Getting device platform version [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 5.1.1 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell wm size' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.product.model' [ADB] Current device property 'ro.product.model': MI 6 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell getprop ro.product.manufacturer' [ADB] Current device property 'ro.product.manufacturer': Xiaomi [AndroidDriver] No app sent in, not parsing package/activity [AndroidDriver] No app capability. Assuming it is already on the device [AndroidBootstrap] Watching for bootstrap disconnect [ADB] Forwarding system: 4724 to device: 4724 [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 forward tcp\:4724 tcp\:4724' [UiAutomator] Starting UiAutomator [UiAutomator] Moving to state 'starting' [UiAutomator] Parsing uiautomator jar [UiAutomator] Found jar name: 'AppiumBootstrap.jar' [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 push C\:\\Users\\zlp\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-android-driver\\bootstrap\\bin\\AppiumBootstrap.jar /data/local/tmp/' [ADB] Attempting to kill all uiautomator processes [ADB] Getting IDs of all 'uiautomator' processes [ADB] Using ps-based PID detection [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell ps' [ADB] No 'uiautomator' process has been found [UiAutomator] Starting UIAutomator [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","127.0.0.1:62001","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.xingin.xhs","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false] [UiAutomator] Moving to state 'online' [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Loading json... [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers. [AndroidBootstrap] Android bootstrap socket is now connected [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell dumpsys window' [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected [AndroidDriver] Screen already unlocked, doing nothing [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n com.xingin.xhs/.activity.SplashActivity -S' [AndroidDriver] Shutting down Android driver [ADB] Running 'D:\android-sdk\sdk\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am force-stop com.xingin.xhs' [BaseDriver] Event 'newSessionStarted' logged at 1553679571306 (17:39:31 GMT+0800 (中国标准时间)) [W3C] Encountered internal error running command: Error: Cannot start the 'com.xingin.xhs' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'D\:\\android-sdk\\sdk\\adt-bundle-windows-x86_64-20140702\\sdk\\platform-tools\\adb.exe -P 5037 -s 127.0.0.1\:62001 shell am start -W -n com.xingin.xhs/.activity.SplashActivity -S' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability [W3C] at ADB.apkUtilsMethods.startApp (C:\Users\zlp\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:144:11) [HTTP] <-- POST /wd/hub/session 500 168162 ms - 1794 [HTTP] ```

Toolbar menu:*.Resources$NotFoundException

toolbar.xml: ``` <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/backup" android:icon="@drawable/ic_backup" android:title="@string/backup" app:showAsAction="always"/> <item android:id="@+id/delete" android:icon="@drawable/ic_delete" android:title="@string/delete" app:showAsAction="ifRoom"/> <item android:id="@+id/setting" android:icon="@drawable/ic_settings" android:title="@string/setting" app:showAsAction="never"/> </menu> ``` mainActivity.xml: ``` <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> </FrameLayout> ``` style.xml: ``` <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> </resources> ``` MainActivity: ``` package com.wang.zhihai.materialtest; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); } @Override public boolean onCreateOptionsMenu(Menu menu) { //加载 toolbar.xml 文件 getMenuInflater().inflate(R.menu.toolbar, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.backup: Toast.makeText(this, "You clicked Backup", Toast.LENGTH_SHORT).show(); break; case R.id.delete: Toast.makeText(this, "You clicked Delete", Toast.LENGTH_SHORT).show(); break; case R.id.setting: Toast.makeText(this, "You clicked Setting", Toast.LENGTH_SHORT).show(); break; default: } return true; } } ``` 求大神帮忙,在Android8 上没问题,在Android6上一运行就崩。

Spring事务总是报org.hibernate.HibernateException: No Session found for current thread

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>今天搞了一下spring mvc的注解,弄到数据库的时候,向数据库中存数据没办法存入成功,看一下错误代码是org.hibernate.HibernateException: No Session found for current thread,网上找了一些方法一直没解决,哪位帮忙看一下,代码如下 <br>applicationContext-db.xml代码: <br><br>&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br>&lt;beans xmlns="http://www.springframework.org/schema/beans" <br>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" <br>xmlns:context="http://www.springframework.org/schema/context" <br>xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" <br>xmlns:aop="http://www.springframework.org/schema/aop" <br>xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd <br>http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd <br>http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd <br>http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd <br>http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd" <br>default-lazy-init="true"&gt; <br><br>&lt;bean id="druid_dataSource" class="com.alibaba.druid.pool.DruidDataSource" <br>init-method="init" destroy-method="close"&gt; <br>&lt;property name="url" value="jdbc:oracle:thin:@localhost:1521:local" /&gt; <br>&lt;property name="username" value="activity" /&gt; <br>&lt;property name="password" value="activitygc" /&gt; <br>&lt;property name="maxActive" value="20" /&gt; <br>&lt;property name="validationQuery" value="select * from dual" /&gt; <br>&lt;property name="testWhileIdle" value="true" /&gt; <br>&lt;/bean&gt; <br><br>&lt;bean id="sessionFactory" <br>class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt; <br>&lt;property name="dataSource" ref="druid_dataSource" /&gt; <br>&lt;property name="packagesToScan" value="com.mvc.model*"&gt;&lt;/property&gt; <br>&lt;property name="hibernateProperties"&gt; <br>&lt;props&gt; <br>&lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/prop&gt; <br>&lt;prop key="show_sql"&gt;true&lt;/prop&gt; <br>&lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt; <br>&lt;prop key="hibernate.jdbc.batch_size"&gt;20&lt;/prop&gt; <br>&lt;!-- &lt;prop key="hibernate.current_session_context_class"&gt;org.springframework.orm.hibernate4.SpringSessionContext <br>&lt;/prop&gt; --&gt; <br>&lt;!-- &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt;  --&gt; <br>&lt;/props&gt; <br>&lt;/property&gt; <br>&lt;/bean&gt; <br><br>&lt;!-- 开启AOP监听 只对当前配置文件有效 --&gt; <br>&lt;aop:aspectj-autoproxy expose-proxy="true" /&gt; <br><br>&lt;!-- 开启注解事务 只对当前配置文件有效 --&gt; <br>&lt;tx:annotation-driven transaction-manager="transactionManager" /&gt; <br>&lt;bean id="txManager" <br>class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt; <br>&lt;property name="sessionFactory" ref="sessionFactory" /&gt; <br>&lt;/bean&gt; <br>&lt;tx:advice id="txAdvice" transaction-manager="txManager"&gt; <br>&lt;tx:attributes&gt; <br>&lt;tx:method name="save*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="add*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="create*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="insert*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="update*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="merge*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="del*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="remove*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="put*" propagation="REQUIRED" /&gt; <br>&lt;tx:method name="use*" propagation="REQUIRED" /&gt; <br>&lt;!-- hibernate4必须配置为开启事务 否则 getCurrentSession()获取不到 --&gt; <br>&lt;tx:method name="get*" propagation="REQUIRED" read-only="true" /&gt; <br>&lt;tx:method name="count*" propagation="REQUIRED" read-only="true" /&gt; <br>&lt;tx:method name="find*" propagation="REQUIRED" read-only="true" /&gt; <br>&lt;tx:method name="list*" propagation="REQUIRED" read-only="true" /&gt; <br>&lt;tx:method name="is*" propagation="REQUIRED" read-only="true" /&gt; <br>&lt;/tx:attributes&gt; <br>&lt;/tx:advice&gt; <br><br>&lt;aop:config expose-proxy="true" proxy-target-class="true"&gt; <br>&lt;!-- 只对数据层实施事务 --&gt; <br>&lt;aop:pointcut id="txPointcut" expression="execution(* com.mvc.dao..*.*(..))" /&gt; <br>&lt;aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut" /&gt; <br>&lt;/aop:config&gt; <br>&lt;!-- 扫描并自动装配 --&gt; <br>&lt;context:component-scan base-package="com.mvc.dao" /&gt; <br>&lt;context:component-scan base-package="com.mvc.service" /&gt; <br>&lt;/beans&gt; <br><br>spring-servlet.xml代码 <br>&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br>&lt;beans xmlns="http://www.springframework.org/schema/beans" <br>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" <br>xmlns:context="http://www.springframework.org/schema/context" <br>xmlns:mvc="http://www.springframework.org/schema/mvc" <br>xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd <br>http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd <br>http://www.springframework.org/schema/mvc <br>http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd" <br>default-lazy-init="true"&gt; <br>&lt;!-- 启用spring mvc 注解 --&gt; <br>&lt;context:annotation-config /&gt; <br>&lt;!-- 把标记了@Controller注解的类转换为bean --&gt; <br>&lt;context:component-scan base-package="com.mvc.*" /&gt; <br>&lt;!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 --&gt; <br>&lt;bean <br>class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt; <br>    &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt;   <br>        &lt;property name="order" value="0"&gt;&lt;/property&gt;   <br>     &lt;/bean&gt; <br>     &lt;!-- 启动 Spring MVC 的注解功能,完成请求和注解 POJO 的映射 --&gt;   <br>     &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;   <br>        &lt;property name="messageConverters"&gt;   <br>            &lt;list&gt;   <br>                 &lt;bean class="org.springframework.http.converter.StringHttpMessageConverter" /&gt;   <br>             &lt;/list&gt;   <br>         &lt;/property&gt;   <br>     &lt;/bean&gt;   <br>     <br>&lt;!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --&gt; <br>&lt;bean <br>class="org.springframework.web.servlet.view.InternalResourceViewResolver" <br>p:prefix="/WEB-INF/test/" p:suffix=".jsp" /&gt; <br><br>&lt;bean id="multipartResolver" <br>class="org.springframework.web.multipart.commons.CommonsMultipartResolver" <br>p:defaultEncoding="utf-8" /&gt; <br>     &lt;/beans&gt;  <br>web.xml <br>&lt;?xml version="1.0" encoding="UTF-8"?&gt;  <br>&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;  <br>  &lt;display-name&gt;s3h3&lt;/display-name&gt;  <br>   &lt;context-param&gt;    <br>     &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;    <br>     &lt;param-value&gt;classpath:applicationContext*.xml&lt;/param-value&gt;    <br>&lt;/context-param&gt;    <br>&lt;listener&gt;    <br>    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;    <br>&lt;/listener&gt;    <br>  &lt;context-param&gt;   <br>        &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;   <br>        &lt;param-value&gt;/WEB-INF/log4j.properties&lt;/param-value&gt;   <br>     &lt;/context-param&gt; <br>&lt;servlet&gt;    <br>     &lt;servlet-name&gt;spring&lt;/servlet-name&gt;    <br>     &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;   <br>     &lt;init-param&gt; <br>&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; <br>&lt;param-value&gt;/WEB-INF/classes/spring-servlet.xml&lt;/param-value&gt; <br>&lt;/init-param&gt; <br>     &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;    <br>&lt;/servlet&gt;   <br>  &lt;filter&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt; <br>&lt;init-param&gt; <br>&lt;param-name&gt;encoding&lt;/param-name&gt; <br>&lt;param-value&gt;utf-8&lt;/param-value&gt; <br>&lt;/init-param&gt; <br>&lt;/filter&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.do&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.jspx&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.jhtml&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.html&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.htm&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;filter-mapping&gt; <br>&lt;filter-name&gt;encoding&lt;/filter-name&gt; <br>&lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt; <br>&lt;/filter-mapping&gt; <br>&lt;servlet-mapping&gt;    <br>     &lt;servlet-name&gt;spring&lt;/servlet-name&gt; <br>     &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;    <br>&lt;/servlet-mapping&gt;    <br>  &lt;welcome-file-list&gt;  <br>    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;  <br>  &lt;/welcome-file-list&gt;  <br>&lt;/web-app&gt; </p> <p> </p> </div>

appium 测试无法打开 app,请各位大神帮忙

初学appium,使用python写测试脚本,现在可以安装上app,之后无法自动启动app。 这是我的脚本: #coding=utf-8 from appium import webdriver from lib2to3.pgen2.driver import Driver from lib2to3.tests.support import driver import os import time PATH=lambda p:os.path.abspath(os.path.join(os.path.dirname(file),p)) global driver desired_caps = {} desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] = '4.4.2' desired_caps['deviceName'] = 'b91b9b66' #desired_caps['appPackage'] = 'com.zhengyuan.watch' #desired_caps['appActivity'] = 'com.zhengyuan.watch.logic.launch.AppStart' desired_caps['app'] = PATH('D:\android\app\rtring_c_zhengyuan.apk') driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) time.sleep(5) driver.swipe(600,660,10,660,1000) time.sleep(1) driver.swipe(600,660,10,660,1000) time.sleep(1) log: info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.4.2","deviceName":"b91b9b66","app":"D:\android\app\rtring_c_zhengyuan.apk","platformName":"Android"}} info: Client User-Agent string: Python-urllib/2.7 info: [debug] No appActivity desired capability or server param. Parsing from apk. info: [debug] No appPackage desired capability or server param. Parsing from apk. info: [debug] Using local app from desired caps: D:\android\app\rtring_c_zhengyuan.apk info: [debug] Creating new appium session 7ab051a1-8c95-4b9a-a998-f1748ed52d47 info: Starting android appium info: [debug] Getting Java version info: Java version is: 1.7.0_79 info: [debug] Checking whether adb is present info: [debug] Using adb from D:\android\sdk\platform-tools\adb.exe info: [debug] Parsing package and activity from app manifest info: [debug] Checking whether aapt is present info: [debug] Using aapt from D:\android\sdk\build-tools\android-4.4W\aapt.exe info: [debug] Extracting package and launch activity from manifest. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\aapt.exe dump badging D:\android\app\rtring_c_zhengyuan.apk info: [debug] badging package: com.zhengyuan.watch info: [debug] badging act: com.zhengyuan.watch.logic.launch.AppStart info: [debug] Parsed package and activity are: com.zhengyuan.watch/com.zhengyuan.watch.logic.launch.AppStart info: [debug] Using fast reset? true info: [debug] Preparing device for session info: [debug] Checking whether app is actually present info: Retrieving device info: [debug] Trying to find a connected android device info: [debug] Getting connected devices... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe devices info: [debug] 1 device(s) connected info: Found device b91b9b66 info: [debug] Setting device id to b91b9b66 info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 wait-for-device info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "echo 'ready'" info: [debug] Starting logcat capture info: [debug] Getting device API level info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: Device API level is: 19 info: [debug] Extracting strings for language: default info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop persist.sys.language" info: [debug] Current device persist.sys.language: zh info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "D:\android\app\rtring_c_zhengyuan.apk" "C:\Users\admin\AppData\Local\Temp\com.zhengyuan.watch" zh info: [debug] Reading strings from converted strings.json info: [debug] Setting language to default info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "C:\Users\admin\AppData\Local\Temp\com.zhengyuan.watch\strings.json" /data/local/tmp info: [debug] Checking whether aapt is present info: [debug] Using aapt from D:\android\sdk\build-tools\android-4.4W\aapt.exe info: [debug] Retrieving process from manifest. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\aapt.exe dump xmltree D:\android\app\rtring_c_zhengyuan.apk AndroidManifest.xml info: [debug] Set app process to: com.zhengyuan.watch info: [debug] Not uninstalling app since server not started with --full-reset info: [debug] Checking app cert for D:\android\app\rtring_c_zhengyuan.apk. info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" D:\android\app\rtring_c_zhengyuan.apk info: [debug] App already signed. info: [debug] Zip-aligning D:\android\app\rtring_c_zhengyuan.apk info: [debug] Checking whether zipalign is present info: [debug] Using zipalign from D:\android\sdk\build-tools\android-4.4W\zipalign.exe info: [debug] Zip-aligning apk. info: [debug] executing cmd: D:\android\sdk\build-tools\android-4.4W\zipalign.exe -f 4 D:\android\app\rtring_c_zhengyuan.apk C:\Users\admin\AppData\Local\Temp\116210-428-1fgurq6\appium.tmp info: [debug] MD5 for app is 310a577ec209ceac8a6dee5086a1bf5d info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ls /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk" info: [debug] Getting install status for com.zhengyuan.watch info: [debug] Getting device API level info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "pm list packages -3 com.zhengyuan.watch" info: [debug] App is installed info: Installing App info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "mkdir -p /data/local/tmp/" info: [debug] Removing any old apks info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ls /data/local/tmp/*.apk" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell rm "/data/local/tmp/8f29ab35c86ad03708a23dfe9aaeeaa0.apk" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "D:\android\app\rtring_c_zhengyuan.apk" /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk info: [debug] Uninstalling com.zhengyuan.watch info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "am force-stop com.zhengyuan.watch" info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 uninstall com.zhengyuan.watch info: [debug] App was uninstalled info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "pm install -r /data/local/tmp/310a577ec209ceac8a6dee5086a1bf5d.apk" info: [debug] Forwarding system:4724 to device:4724 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 forward tcp:4724 tcp:4724 info: [debug] Pushing appium bootstrap to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/ info: [debug] Pushing settings apk to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk" info: [debug] Pushing unlock helper app to device... info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk" info: Starting App info: [debug] Attempting to kill all 'uiautomator' processes info: [debug] Getting all processes with 'uiautomator' info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "ps 'uiautomator'" info: [debug] Attempting to kill process 31936 info: [debug] executing cmd: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell "kill 31936" info: [debug] Running bootstrap info: [debug] spawning: D:\android\sdk\platform-tools\adb.exe -s b91b9b66 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.zhengyuan.watch -e disableAndroidWatchers false info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1 info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724 info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready info: [debug] [BOOTSTRAP] [debug] Loading json... error: Unhandled error: Error: getaddrinfo ENOENT at Object.exports.errnoException (util.js:746:11) at errnoException (dns.js:49:15) at GetAddrInfoReqWrap.onlookup as oncomplete context: [POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.4.2","deviceName":"b91b9b66","app":"D:\android\app\rtringc_zhengyuan.apk","platformName":"Android"}}] info: [debug] [BOOTSTRAP] [debug] json loading complete. info: [debug] [BOOTSTRAP] [debug] Registered crash watchers. info: <-- POST /wd/hub/session - - ms - - undefined 之后就停住了,请大家帮我看看是什么问题,纠结了好几天了,谢谢大家!

Android使用Xutils3下载安装apk报错问题,求解

1.根据xutils3的文档说明,创建了一个类对xutils进行初始化 ``` public class MyApp extends Application { @Override public void onCreate() { super.onCreate(); x.Ext.init(this); x.Ext.setDebug(false); } } ``` 2.然后在配置文件中做了如下配置 ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.gao.mysafe"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.INSTALL_PACKAGES" tools:ignore="ProtectedPermissions" /> <application android:name=".MyApp" android:allowBackup="true" android:icon="@mipmap/safe_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity"></activity> </application> </manifest> ``` 3.在activity中调用了xutils的下载方法 ``` //apk下载地址,放置apk的路径 //1.获取sd卡路径 String path = Environment.getExternalStorageDirectory().getPath() + "/mysafe.apk"; //2.发送请求,获取apk,并放到指定路径 RequestParams rp = new RequestParams(url); rp.setSaveFilePath(path); rp.setAutoRename(true); x.http().get(rp, new Callback.ProgressCallback<File>() { //下载成功 @Override public void onSuccess(File result) { ToastUtils.show(SplashActivity.this, "下载成功,开始安装!!"); installAPK(result); } //下载出现问题 @Override public void onError(Throwable ex, boolean isOnCallback) { } @Override public void onCancelled(CancelledException cex) { } @Override public void onFinished() { } @Override public void onWaiting() { } //刚刚开始下载 @Override public void onStarted() { } //下载过程中方法 @Override public void onLoading(long total, long current, boolean isDownloading) { } }); ``` 然后在模拟器中出现了如下问题 ``` D/dalvikvm: Not late-enabling CheckJNI (already on) I/InstantRun: Instant Run Runtime started. Android package is com.gao.mysafe, real application class is com.gao.mysafe.MyApp. W/InstantRun: No instant run dex files added to classpath D/dalvikvm: GC_FOR_ALLOC freed 68K, 5% free 2929K/3056K, paused 2ms, total 3ms I/dalvikvm-heap: Grow heap (frag case) to 34.554MB for 33177612-byte allocation D/dalvikvm: GC_FOR_ALLOC freed <1K, 1% free 35328K/35460K, paused 5ms, total 5ms D/OpenGLRenderer: Enabling debug mode 0 I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts W/dalvikvm: VFY: unable to resolve interface method 16550: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;) I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested W/dalvikvm: VFY: unable to resolve interface method 16552: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode W/dalvikvm: VFY: unable to resolve interface method 16556: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations W/dalvikvm: VFY: unable to resolve virtual method 747: Landroid/content/res/TypedArray;.getChangingConfigurations ()I D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType W/dalvikvm: VFY: unable to resolve virtual method 769: Landroid/content/res/TypedArray;.getType (I)I D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008 I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable W/dalvikvm: VFY: unable to resolve virtual method 710: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity W/dalvikvm: VFY: unable to resolve virtual method 712: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering W/dalvikvm: VFY: unable to resolve instanceof 158 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper; D/dalvikvm: VFY: replacing opcode 0x20 at 0x000c I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList W/dalvikvm: VFY: unable to resolve virtual method 470: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList; D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006 ``` 4.调用安装方法后也出现了错误 ``` private void installAPK(File file) { //系统应用界面,源码,安装apk入口 Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory("android.intent.category.DEFAULT"); //文件作为数据源 intent.setData(Uri.fromFile(file)); //设置安装类型 intent.setType("application/vnd.android.package-archive"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); /* 也可以用下面代码一行完成 intent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive"); */ try{ startActivityForResult(intent, 0); }catch (Exception e){ e.printStackTrace(); } } ``` 问题如下: ``` D/dalvikvm: GC_FOR_ALLOC freed 422K, 2% free 36957K/37436K, paused 3ms, total 3ms W/System.err: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] typ=application/vnd.android.package-archive flg=0x10000000 } W/System.err: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632) W/System.err: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) W/System.err: at android.app.Activity.startActivityForResult(Activity.java:3424) W/System.err: at android.app.Activity.startActivityForResult(Activity.java:3385) W/System.err: at com.gao.mysafe.SplashActivity.installAPK(SplashActivity.java:338) W/System.err: at com.gao.mysafe.SplashActivity.access$500(SplashActivity.java:30) W/System.err: at com.gao.mysafe.SplashActivity$6.onSuccess(SplashActivity.java:280) W/System.err: at com.gao.mysafe.SplashActivity$6.onSuccess(SplashActivity.java:275) W/System.err: at org.xutils.http.HttpTask.onSuccess(HttpTask.java:447) W/System.err: at org.xutils.common.task.TaskProxy$InternalHandler.handleMessage(TaskProxy.java:198) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err: at android.os.Looper.loop(Looper.java:136) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5017) W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) W/System.err: at dalvik.system.NativeStart.main(Native Method) ``` 弄了半天不知道是什么问题,在真机上也不好使,安装不上,求大神解答一下,谢谢了!!

Android 程序6.0没有问题,5.1出现了下面的问题,求大佬指点,在线等

D/AccessibilityManager: setStateLocked: wasEnabled = false, mIsEnabled = false, wasTouchExplorationEnabled = false, mIsTouchExplorationEnabled = false, wasHighTextContrastEnabled = false, mIsHighTextContrastEnabled = false java.lang.Throwable: setStateLocked at android.view.accessibility.AccessibilityManager.setStateLocked(AccessibilityManager.java:553) at android.view.accessibility.AccessibilityManager.tryConnectToServiceLocked(AccessibilityManager.java:636) at android.view.accessibility.AccessibilityManager.<init>(AccessibilityManager.java:226) at android.view.accessibility.AccessibilityManager.getInstance(AccessibilityManager.java:206) at android.view.View.setFlags(View.java:9843) at android.view.ViewGroup.initViewGroup(ViewGroup.java:536) at android.view.ViewGroup.<init>(ViewGroup.java:525) at android.view.ViewGroup.<init>(ViewGroup.java:520) at android.view.ViewGroup.<init>(ViewGroup.java:516) at android.view.ViewGroup.<init>(ViewGroup.java:512) at android.widget.FrameLayout.<init>(FrameLayout.java:119) at com.android.internal.policy.impl.PhoneWindow$DecorView.<init>(PhoneWindow.java:2328) at com.android.internal.policy.impl.PhoneWindow.generateDecor(PhoneWindow.java:3465) at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3851) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:411) at android.app.Activity.setContentView(Activity.java:2175) at com.github.system.MainActivity.onCreate(MainActivity.java:41) at android.app.Activity.performCreate(Activity.java:6100) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614) at android.app.ActivityThread.access$800(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5643) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)

《第一行代码》隐式Intent的用法中跳转百度页面和拨号界面的都崩了,新手,求指导。

button1.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ Intent intent = new Intent("Intent.ACTION_DIAL"); intent.setData(Uri.parse("tel:10086")); startActivity(intent); } }); <activity android:name=".ThirdActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="http" /> </intent-filter> </activity> 运行时点一下button1就崩

关于真机运行和虚拟机运行的小问题

在一个fragment里面写了一个SwipeRefreshLayout内含listview。真机运行的时候 listview的内容不会显示,但虚拟机会显示,listview的内容原是自己电脑作为服务器的 jsp传递的,这个下拉刷新两者都能用,请问这是什么原因??怎么解决 贴上代码 package com.example.my_coffeehouse.fragment; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.example.my_coffeehouse.activity.R; import com.example.my_coffeehouse.util.Constant; import com.example.my_coffeehouse.util.HttpUploadUtil; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import android.widget.SimpleAdapter; /** * 这是订单页面 * * @author Administrator * */ public class Main_OrderFragment extends Fragment { private static final int REFRESH_COMPLETE = 0X110; private SwipeRefreshLayout mSwipeLayout; private SimpleAdapter sa; private View view; private ListView lv; private String aurl = Constant.aURL + "/order/AshowOrder.jsp"; private Map<String, String> params; // 与服务器交互的标识 private Handler handler; private String[] listArray; @SuppressLint({ "HandlerLeak", "InlinedApi" }) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.inflate(R.layout.main_item_order, container, false);// 这个就相当于你加的布局 params = new HashMap<String, String>(); params.put("parame1", "wok"); new Thread() { public void run() { // 获取服务器端传输到客户端的字符串 String msgStr = HttpUploadUtil.postWithoutFile(aurl, params); Bundle b = new Bundle(); b.putString("msg", msgStr); Message msg = new Message(); msg.setData(b); msg.what = Constant.WORKER; handler.sendMessage(msg); }// run }.start(); mSwipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.order_swipe); mSwipeLayout.setColorScheme(android.R.color.holo_green_dark, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); mSwipeLayout.setOnRefreshListener(new OnRefreshListener() { public void onRefresh() { handler.sendEmptyMessageDelayed(REFRESH_COMPLETE, 2000); } }); // 将子线程执行的结果,交互主线程 handler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case Constant.WORKER: Bundle b = msg.getData(); String m = b.getString("msg"); // 将子线程执行结果,m,交互给主线程UI层,即listView显示。 initData(m); break; case REFRESH_COMPLETE: // mDatas.addAll(Arrays.asList("Lucene", // "Canvas","Bitmap")); // sa.notifyDataSetChanged(); mSwipeLayout.setRefreshing(false); break; default: break; } } };// handler; return view; } /** * 将jsp返回的值进行解析 * * @param msg */ private void initData(String msg) { listArray = msg.split("\\|"); final int count = listArray.length / 5;// 多少条记录 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); Map<String, Object> map = new HashMap<String, Object>(); for (int i = 0; i < count; i++) { map = new HashMap<String, Object>(); map.put("shop", listArray[5 * i + 1]); map.put("content", listArray[5 * i + 4]); map.put("money", listArray[5 * i + 2]); map.put("time", listArray[5 * i + 3]); map.put("transition", "已完成"); list.add(map); } lv = (ListView) view.findViewById(R.id.find_listview); sa = new SimpleAdapter(this.getActivity(), list, R.layout.find_listview_item, new String[] { "shop", "content", "money", "time", "transition" }, new int[] { R.id.find_lv_item_shop, R.id.find_lv_item_content, R.id.find_lv_item_money, R.id.find_lv_item_time, R.id.find_lv_item_transition }); lv.setAdapter(sa); } }

android R文件不更新问题,已勾选自动更新

MainActivity.java ``` package com.example; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. switch(item.getItemId()){ case R.id.start: case R.id.stop: invalidateOptionsMenu(); break; case R.id.exit: finish(); break; default: break; } Toast.makeText(MainActivity.this, item.getTitle()+"被单击了", 1000).show(); return true; } public boolean onPrepareOptionsMenu(Menu menu){ super.onPrepareOptionsMenu(menu); MenuItem start=menu.findItem(R.id.start); MenuItem stop=menu.findItem(R.id.stop); boolean flag = false; start.setEnabled(flag); stop.setEnabled(!flag); flag=!flag; return true; } } ``` /* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.example; public final class R { public static final class attr { } public static final class dimen { /** Default screen margins, per the Android Design guidelines. Example customization of dimensions originally defined in res/values/dimens.xml (such as screen margins) for screens with more than 820dp of available width. This would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). */ public static final int activity_horizontal_margin=0x7f040000; public static final int activity_vertical_margin=0x7f040001; } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int action_settings=0x7f080000; } public static final class layout { public static final int activity_main=0x7f030000; } public static final class menu { public static final int main=0x7f070000; } public static final class string { public static final int action_settings=0x7f050002; public static final int app_name=0x7f050000; public static final int hello_world=0x7f050001; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f060001; } } R文件id里不产生start ,stop ,exit的相关数据

android 百度地图 搜索跳转

一共有两个Activity ,第一个Activity显示地图,实现定位当前地址并输出在第一个页面的EditText里,第二个Activity是搜索页面,搜索框是EditText,ListView显示搜索结果,使用百度地图建议搜索功能。比如搜索一个万达广场,点击搜索结果后希望在第一个Activity的地图上显示当前定位地址和到万达广场的路线规划,就是起点和终点显示出来。 (这里需要起点自动获取,因为地图已经实现自动定位当前地址了,不要那种既要输入起点,又要输入终点,最后还得要点击一下确定,才会显示结果的那种无语的操作体验,整个软件是没有一个Bundle按钮的,只需要item) 现在的问题是点击第二个页面ListView里面的搜索结果万达广场,跳转到第一个页面之后没有任何反应。 谢谢各位大神哥哥姐姐~请帮我实现Intent ,使用的是startactivityforresult,数据传送和接收,在接收后的onActivityResult里面进行处理 第一个页面 public class MainActivity extends Activity { private MapView mMapView = null; private BaiduMap mBaidumap =null; private PoiSearch mPoiSearch = null; private EditText mTv = null; private LocationClient mLocClient; private MainActivity.MyLocationListener myListener = new MainActivity.MyLocationListener(); private int mCurrentDirection = 0; private Double lastX = 0.0; private MyLocationData locData; private float mCurrentAccracy; private double mCurrentLat = 0.0; private double mCurrentLon = 0.0; private String mCityName; boolean isFirstLoc = true; BitmapDescriptor mCurrentMarker; private SensorManager mSensorManager; private MyLocationConfiguration.LocationMode mCurrentMode; private MainActivity.DirectionSensorListener DirectionListener = new MainActivity.DirectionSensorListener(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SDKInitializer.initialize(getApplicationContext()); setContentView(R.layout.content_main); mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//获取传感器管理服务 mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL; //初始化地图 mMapView = (MapView) findViewById(R.id.mapView); mTv = (EditText) findViewById(R.id.tiaozhuan); mTv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Bundle bundle = new Bundle(); bundle.putString("userName", "zhangsan"); bundle.putInt("userAge", 100); Intent intent = new Intent(MainActivity.this, Main2Activity.class); intent.putExtras(bundle); startActivityForResult(intent, 1);// } }); /*protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub switch (requestCode){ case RESULT_OK: Bundle bundle=data.getExtras(); String str=bundle.getString("backData"); Toast.makeText(MainActivity.this, str,Toast.LENGTH_LONG).show(); break; default: break; }*/ mBaidumap = mMapView.getMap(); mMapView.showScaleControl(false); mMapView.showZoomControls(false); UiSettings settings = mBaidumap.getUiSettings(); settings.setOverlookingGesturesEnabled(false);//设置双指下拉时不启用3D地图 settings.setRotateGesturesEnabled(false);//设置地图不可旋转 //开启定位图层 mBaidumap.setMyLocationEnabled(true); initLocation(); //initPoiSearch(); mPoiSearch = PoiSearch.newInstance(); mPoiSearch.setOnGetPoiSearchResultListener(new OnGetPoiSearchResultListener() { @Override public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) { if (poiDetailResult == null || poiDetailResult.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) { Toast.makeText(MainActivity.this, "未找到结果", Toast.LENGTH_LONG) .show(); return; } if (poiDetailResult.error == SearchResult.ERRORNO.NO_ERROR) { //搜索到POI mBaidumap.clear(); mBaidumap.addOverlay(new MarkerOptions() .position(poiDetailResult.location) .icon(BitmapDescriptorFactory.fromResource(R.drawable.alf)) .title(poiDetailResult.getAddress())); //讲该POI设置为地图中心 mBaidumap.setMapStatus(MapStatusUpdateFactory.newLatLng(poiDetailResult.location)); Toast.makeText(MainActivity.this, "搜索中...", Toast.LENGTH_LONG).show(); return; } } @Override public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) { } @Override public void onGetPoiResult(PoiResult poiResult) { } }); } private void initLocation() { mLocClient = new LocationClient(this); mLocClient.registerLocationListener(myListener); LocationClientOption option = new LocationClientOption(); option.setOpenGps(true);//打开GPS option.setCoorType("bd09ll");//设置坐标类型 option.setIsNeedAddress(true);//是否需要地址信息 option.setScanSpan(1000); LocationPermission(); mLocClient.setLocOption(option); } private void LocationPermission() { int checkPermission = ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION); if (checkPermission != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1); Log.d("未获得定位权限", "弹出提示"); return; } } public class DirectionSensorListener implements SensorEventListener { @Override public void onSensorChanged(SensorEvent event) { double x = event.values[SensorManager.DATA_X]; if (Math.abs(x - lastX) > 1.0) { mCurrentDirection = (int) x; //设置定位数据 locData = new MyLocationData.Builder() .accuracy(mCurrentAccracy)//精度 .direction(mCurrentDirection) //此处设置开发者获取到的方向信息,顺时针0-360 .latitude(mCurrentLat)//经度 .longitude(mCurrentLon)//纬度 .build(); mBaidumap.setMyLocationData(locData); } lastX = x; } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } } public class MyLocationListener implements BDLocationListener { @Override public void onReceiveLocation(BDLocation bdLocation) { //map view销毁后不在处理新接受的位置 if (bdLocation == null || mMapView == null) { return; } mCurrentLat = bdLocation.getLatitude(); mCurrentLon = bdLocation.getLongitude(); mCurrentAccracy = bdLocation.getRadius(); mCityName = bdLocation.getCity(); //设置定位数据 locData = new MyLocationData.Builder() .accuracy(bdLocation.getRadius())//精度 .direction(mCurrentDirection) //此处设置开发者获取到的方向信息,顺时针0-360 .latitude(bdLocation.getLatitude())//经度 .longitude(bdLocation.getLongitude())//纬度 .build(); mBaidumap.setMyLocationData(locData); //第一次定位时,将地图位置移动到当前位置 if (isFirstLoc) { isFirstLoc = false; LatLng ll = new LatLng(bdLocation.getLatitude(), bdLocation.getLongitude()); MapStatus.Builder builder = new MapStatus.Builder(); builder.target(ll).zoom(18.0f); mBaidumap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); mCurrentMarker = null; mBaidumap .setMyLocationConfiguration(new MyLocationConfiguration( mCurrentMode, true, null)); } } } @Override protected void onStart() { //为系统的方向传感器注册监听器 mSensorManager.registerListener(DirectionListener, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION) , SensorManager.SENSOR_DELAY_UI); //启动监听 mLocClient.start(); super.onStart(); } @Override protected void onPause() { mMapView.onPause(); super.onPause(); } @Override protected void onResume() { mMapView.onResume(); super.onResume(); } @Override protected void onStop() { //取消传感器监听 mSensorManager.unregisterListener(DirectionListener); super.onStop(); } @Override protected void onDestroy() { //退出时销毁定位 mLocClient.stop(); //关闭定位图层 mBaidumap.setMyLocationEnabled(false); mMapView.onDestroy(); //mMapView = null; // mPoiSearch.destroy(); //mSuggestionSearch.destroy(); super.onDestroy(); } } 第二个页面 public class Main2Activity extends Activity implements OnGetSuggestionResultListener { private EditText et_address; private Adapter_list_Address adapter_list_Address; private ListView myListView; private List<String> list = new ArrayList<>(); private List<String> lists = new ArrayList<>(); //地图相关 /** * 百度地图控件 */ MapView mMapView = null; /** * 百度地图实例 */ BaiduMap mBaidumap = null; //定位相关 /** * 定位客户端 */ LocationClient mLocClient; /** * 定位模式 */ private LocationMode mCurrentMode; /** * 定位图标 */ BitmapDescriptor mCurrentMarker; /** * 传感器管理器 */ private SensorManager mSensorManager; /** * 当前方向 */ private int mCurrentDirection = 0; /** * 当前经度 */ private double mCurrentLat = 0.0; /** * 当前纬度 */ private double mCurrentLon = 0.0; /** * 当前经度 */ private float mCurrentAccracy; /** * 是否首次定位 */ boolean isFirstLoc = true; /** * 定位数据 */ private MyLocationData locData; /** * 定位监听 */ private MyLocationListener myListener = new MyLocationListener(); /** * 方向监听 */ private DirectionSensorListener DirectionListener = new DirectionSensorListener(); /** * 上一次的方向 */ private Double lastX = 0.0; /** * 定位所在城市 */ private String mCityName; //poi搜索相关 /** * Poi检索实例 */ private PoiSearch mPoiSearch = null; private SuggestionSearch mSuggestionSearch = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SDKInitializer.initialize(getApplicationContext()); setContentView(R.layout.activity_main2); mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//获取传感器管理服务 mCurrentMode = LocationMode.NORMAL; //初始化地图 mMapView = (MapView) findViewById(R.id.mapView2); mBaidumap = mMapView.getMap(); mMapView.showScaleControl(false); mMapView.showZoomControls(false); UiSettings settings = mBaidumap.getUiSettings(); settings.setOverlookingGesturesEnabled(false);//设置双指下拉时不启用3D地图 settings.setRotateGesturesEnabled(false);//设置地图不可旋转 //开启定位图层 mBaidumap.setMyLocationEnabled(true); initLocation(); initPoiSearch(); initData(); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { ShowKeyboard(et_address); } }, 500); } private void initData() { et_address = (EditText) findViewById(R.id.et_address); myListView = (ListView) findViewById(R.id.lv_address); mPoiSearch = PoiSearch.newInstance(); mPoiSearch.setOnGetPoiSearchResultListener(new OnGetPoiSearchResultListener() { @Override public void onGetPoiResult(PoiResult poiResult) { if (poiResult == null || poiResult.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) { Toast.makeText(Main2Activity.this, "未找到结果", Toast.LENGTH_LONG).show(); return; } if (poiResult.error == SearchResult.ERRORNO.NO_ERROR) { } if (poiResult.error == SearchResult.ERRORNO.AMBIGUOUS_KEYWORD) { //当输入关键字在本市没有找到,但是在其他城市找到时,返回包含该关键字信息的城市列表 String strInfo = "在"; for (CityInfo cityInfo : poiResult.getSuggestCityList()) { strInfo += cityInfo.city; strInfo += ","; } strInfo += "找到结果"; Toast.makeText(Main2Activity.this, strInfo, Toast.LENGTH_LONG).show(); } } @Override public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) { if (poiDetailResult == null || poiDetailResult.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) { Toast.makeText(Main2Activity.this, "未找到结果", Toast.LENGTH_LONG) .show(); return; } if (poiDetailResult.error == SearchResult.ERRORNO.NO_ERROR) { //搜索到POI mBaidumap.clear(); mBaidumap.addOverlay(new MarkerOptions() .position(poiDetailResult.location) .icon(BitmapDescriptorFactory.fromResource(R.drawable.alf)) .title(poiDetailResult.getAddress())); //讲该POI设置为地图中心 mBaidumap.setMapStatus(MapStatusUpdateFactory.newLatLng(poiDetailResult.location)); Toast.makeText(Main2Activity.this, "搜索中...", Toast.LENGTH_LONG).show(); return; } } @Override public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) { } }); //初始化建议搜索模块,注册建议搜索事件监听 mSuggestionSearch = SuggestionSearch.newInstance(); mSuggestionSearch.setOnGetSuggestionResultListener(this); et_address.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable arg0) { if (adapter_list_Address != null) { adapter_list_Address.notifyDataSetChanged(); } mSuggestionSearch .requestSuggestion((new SuggestionSearchOption()) .keyword(et_address.getText().toString()).city("北京")); } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { if (adapter_list_Address != null) { adapter_list_Address.notifyDataSetChanged(); } mSuggestionSearch .requestSuggestion((new SuggestionSearchOption()) .keyword(et_address.getText().toString()).city("北京")); } @Override public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) { if (cs.length() < 0) { return; } /** * 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新 */ if (adapter_list_Address != null) { adapter_list_Address.notifyDataSetChanged(); } mSuggestionSearch .requestSuggestion((new SuggestionSearchOption()) .keyword(et_address.getText().toString()).city("北京")); } }); } @Override public void onGetSuggestionResult(final SuggestionResult msg) { // TODO Auto-generated method stub if (msg == null || msg.getAllSuggestions() == null) { Toast.makeText(Main2Activity.this, "未检索到当前地址", Toast.LENGTH_SHORT).show(); return; } if (list != null) { list.clear(); } if (lists != null) { lists.clear(); } for (SuggestionResult.SuggestionInfo info : msg.getAllSuggestions()) { Log.e("info.ccity", "info.city" + info.city + "info.district" + info.district + "info.key" + info.key); list.add(info.key); lists.add(info.city + info.district + info.key); adapter_list_Address = new Adapter_list_Address(Main2Activity.this, list, lists); myListView.setAdapter(adapter_list_Address); myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { SuggestionResult.SuggestionInfo info = msg.getAllSuggestions().get(position); mPoiSearch.searchPoiDetail(new PoiDetailSearchOption().poiUid(info.uid)); Intent intentAddress = new Intent(); intentAddress.putExtra("backData",et_address.getText().toString()); setResult(RESULT_OK,intentAddress); finish(); } }); adapter_list_Address.notifyDataSetChanged(); } } public static void ShowKeyboard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(v, InputMethodManager.SHOW_FORCED); } public static void HideKeyboard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); if (imm.isActive()) { imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), 0); } } /** * 初始化定位相关 */ private void initLocation() { mLocClient = new LocationClient(this); mLocClient.registerLocationListener(myListener); LocationClientOption option = new LocationClientOption(); option.setOpenGps(true);//打开GPS option.setCoorType("bd09ll");//设置坐标类型 option.setIsNeedAddress(true);//是否需要地址信息 option.setScanSpan(1000); LocationPermission(); mLocClient.setLocOption(option); } /** * poi搜索相关 */ private void initPoiSearch() { //初始化搜索模块,注册搜索事件监听 mPoiSearch = PoiSearch.newInstance(); //mPoiSearch.setOnGetPoiSearchResultListener(this); } /** * 获取GPS定位权限(Android6.0 以上需要动态获取权限) */ private void LocationPermission() { int checkPermission = ContextCompat.checkSelfPermission(Main2Activity.this, Manifest.permission.ACCESS_COARSE_LOCATION); if (checkPermission != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(Main2Activity.this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1); Log.d("未获得定位权限", "弹出提示"); return; } } /** * 方向监听 */ public class DirectionSensorListener implements SensorEventListener { @Override public void onSensorChanged(SensorEvent event) { double x = event.values[SensorManager.DATA_X]; if (Math.abs(x - lastX) > 1.0) { mCurrentDirection = (int) x; //设置定位数据 locData = new MyLocationData.Builder() .accuracy(mCurrentAccracy)//精度 .direction(mCurrentDirection) //此处设置开发者获取到的方向信息,顺时针0-360 .latitude(mCurrentLat)//经度 .longitude(mCurrentLon)//纬度 .build(); mBaidumap.setMyLocationData(locData); } lastX = x; } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } } /** * 定位监听 */ public class MyLocationListener implements BDLocationListener { @Override public void onReceiveLocation(BDLocation bdLocation) { //map view销毁后不在处理新接受的位置 if (bdLocation == null || mMapView == null) { return; } mCurrentLat = bdLocation.getLatitude(); mCurrentLon = bdLocation.getLongitude(); mCurrentAccracy = bdLocation.getRadius(); mCityName = bdLocation.getCity(); //设置定位数据 locData = new MyLocationData.Builder() .accuracy(bdLocation.getRadius())//精度 .direction(mCurrentDirection) //此处设置开发者获取到的方向信息,顺时针0-360 .latitude(bdLocation.getLatitude())//经度 .longitude(bdLocation.getLongitude())//纬度 .build(); mBaidumap.setMyLocationData(locData); //第一次定位时,将地图位置移动到当前位置 if (isFirstLoc) { isFirstLoc = false; LatLng ll = new LatLng(bdLocation.getLatitude(), bdLocation.getLongitude()); MapStatus.Builder builder = new MapStatus.Builder(); builder.target(ll).zoom(18.0f); mBaidumap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build())); mCurrentMarker = null; mBaidumap .setMyLocationConfiguration(new MyLocationConfiguration( mCurrentMode, true, null)); } } } @Override protected void onStart() { //为系统的方向传感器注册监听器 mSensorManager.registerListener(DirectionListener, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION) , SensorManager.SENSOR_DELAY_UI); //启动监听 mLocClient.start(); super.onStart(); } @Override protected void onPause() { mMapView.onPause(); super.onPause(); } @Override protected void onResume() { mMapView.onResume(); super.onResume(); } @Override protected void onStop() { //取消传感器监听 mSensorManager.unregisterListener(DirectionListener); super.onStop(); } @Override protected void onDestroy() { //退出时销毁定位 mLocClient.stop(); //关闭定位图层 mBaidumap.setMyLocationEnabled(false); mMapView.onDestroy(); mMapView = null; mPoiSearch.destroy(); mSuggestionSearch.destroy(); super.onDestroy(); } }

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

你以为这样写Java代码很6,但我看不懂

为了提高 Java 编程的技艺,我最近在 GitHub 上学习一些高手编写的代码。下面这一行代码(出自大牛之手)据说可以征服你的朋友,让他们觉得你写的代码很 6,来欣赏一下吧。 IntStream.range(1, 5).boxed().map(i -&gt; { System.out.print("Happy Birthday "); if (i == 3) return "dear NAME"...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

立即提问
相关内容推荐