iOS app crashes at launch because of distribution

2019-07-19 15:28发布

问题:

My iOS app was rejected twice for submission for the same reason: crash at start. Given the logs I guess it comes from my provisioning profiles and sign identity. I am using Libgdx 1.5.x with RoboVM beta 4, with Eclipse

When I build the app with no profile, it builds and runs fine on any simulator. With a developer profile, the app builds and runs fine on my test device. Everything is fine until I set iosSignIdentity and iosProvisioningProfile to distribution, there I am having the following error:

Building from console with the following command:

./gradlew -Probovm.device.name=<my device name> launchIOSDevice --stacktrace

I am getting error:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ios:launchIOSDevice'.
...
Caused by: org.robovm.libimobiledevice.LibIMobileDeviceException: ApplicationVerificationFailed
at org.robovm.libimobiledevice.util.AppLauncher$1.error(AppLauncher.java:1001)
at org.robovm.libimobiledevice.Callbacks.callInstproxyCallback(Callbacks.java:64)

The log from my device (taken from Xcode) is:

<Error>: profile not valid: 0xe8008012
<Error>: 0x1e3000 install_embedded_profile: Could not install embedded profile: 0xe8008012
<Error>: 0x1e3000 verify_signer_identity: MISValidateSignatureAndCopyInfo failed for /var/tmp/install_staging.6O8w3D/IOSLauncher.app/IOSLauncher: 0xe8008015

Here is the provisioning profile I have created for distribution, it is linked to my Ditribution certificate and my app:

in my build.gradle I have set identity and profile like this:

    robovm {
iosSignIdentity = "iPhone Distribution: <my name> (PK79UD6TA3)"
iosProvisioningProfile = "DistribKM"
iosSkipSigning = false
stdoutFifo = null
stderrFifo = null
}

}

I am taking the iosSignIdentity from this command line:

And this is where I am lost. I can build the app with

./gradlew -Probovm.ipaArchs=thumbv7:arm64 build createIPA

The build will be succesfull. But I am almost sure that if I upload and submit this build for revision, Apple will reject it for the 3rd time for same reason as the 2 previous ones: "app crashes at start".

Here is what it looks like once uploaded to iTunes Connect:

How can I make sure the app will work properly with the distribution profile before I submit it?

回答1:

Answering to myself, it might help others to know that despite this build crashing on any device, it was approved by Apple a couple of hours ago. So if you have the same problems described here, triple check everything one last time, your build will crash but it can be approved by Apple. It is just a pitty that with Libgdx Robovm, it is either impossible or very difficult to use XCode to check provisioning profiles and certificates, so you basically have to take a leap of faith... Hope it helps



回答2:

We had the same problem and even our app was also rejected twice. We made build with adHoc profile using eclipse (not in console) and the build crashed on every 64-bit device we had tried on. So it seems that somehow in standard way of making IPA from "eclipse" the 64-bit architecture is missed. (I'm sure i chose all parameters correctly).

Building IPA in console solved the problem.

./gradlew -Probovm.ipaArchs=thumbv7:arm64 build createIPA


回答3:

I encountered the same problem. Now it has been fixed. I use maven to manage the dependency (that's the problem). When you run the app with simulator or real device by eclipse roboVM plugin, the maven dependency will be packed to the target ipa and deploy to your simulator or real device, so it works fine. But when you use Robo VM Tools -> Package for app store/Ad-Hoc distribution... to export ipa file, the maven dependencies does not be exported to the target ipa. The fix solution is put all the dependencies to you core project's lib folder and add to the build path.



回答4:

** latest update: skipped the android problem and solved the binding projects problems, for anyone who has this problem, see this link http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=11145&p=79057#p79057 **

can you guys give any reference for setting up gradle from command line?

./gradlew -Probovm.ipaArchs=thumbv7:arm64 build createIPA

I've taken a look at https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline but this doesn't help much. Whenever I run the code above, it compiles all projects including Android (however, I have difficulty setting up Gradle with external dependencies); eclipse runs fine tho. Is it possible to only compile 'core'+'ios'? such as something like the following

./gradlew -Probovm.ipaArchs=thumbv7:arm64 core:build ios:createIPA

* UPDATE * okay, circumvented the first issue by creating another temp project and removing android from the new project, when I build it says Could not determine the dependencies of task ':ios:compileJava' what does that mean?

with --debug

20:54:47.851 [INFO] [org.gradle.execution.TaskNameResolvingBuildConfigurationAction] Selected primary task 'build' from project :
20:54:47.855 [ERROR] [org.gradle.BuildExceptionReporter] 
20:54:47.855 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
20:54:47.856 [ERROR] [org.gradle.BuildExceptionReporter] 
20:54:47.856 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
20:54:47.856 [ERROR] [org.gradle.BuildExceptionReporter] Could not determine the dependencies of task ':ios:compileJava'.
20:54:47.856 [ERROR] [org.gradle.BuildExceptionReporter] > Could not determine the dependencies of task ':ios:compileJava'.
20:54:47.856 [ERROR] [org.gradle.BuildExceptionReporter] 
20:54:47.857 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
20:54:47.857 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
20:54:47.857 [LIFECYCLE] [org.gradle.BuildResultLogger] 
20:54:47.857 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
20:54:47.857 [LIFECYCLE] [org.gradle.BuildResultLogger] 
20:54:47.858 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 1.288 secs

with --stacktrace

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':ios:compileJava'.
> Configuration with name 'default' not found.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleException: Could not determine the dependencies of task ':ios:compileJava'.
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:65)
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:53)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionPlan.java:112)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.java:76)
    at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:47)
    at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
    at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
    at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
    at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
    at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
    at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
    at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
    at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:46)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'default' not found.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.createNotFoundException(DefaultConfigurationContainer.java:79)
    at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:192)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:69)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:33)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency.getProjectConfiguration(DefaultProjectDependency.java:69)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency_Decorated.getProjectConfiguration(Unknown Source)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$TaskDependencyImpl.resolve(DefaultProjectDependency.java:164)
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:86)
    at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200)
    at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)
    at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:74)
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:63)
    ... 47 more


BUILD FAILED