Make sure to create a data folder in your app directory. Add the tpk to the data folder. I have tested this sample code and it works on both android and iPad. Can you please test it by uploading this sample and test it in the player?
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import ArcGIS.AppFramework.Runtime 1.0
App {
id: app
width: 800
height: 532
property string runtimePath: AppFramework.userHomeFolder.filePath("ArcGIS/Runtime")
property string dataPath: runtimePath + "/Data"
property string inputTPK: "test.tpk"
property string outputTPK: dataPath + "/" + inputTPK
function copyLocalData(input, output) {
var resourceFolder = AppFramework.fileFolder(app.folder.folder("Data").path);
AppFramework.userHomeFolder.makePath(dataPath);
resourceFolder.copyFile(input, output);
return output
}
Envelope {
id: sfExtent
xMin: -13643665.582273144
yMin: 4533030.152110769
xMax: -13618899.985108782
yMax: 4554203.2089457335
}
Map {
id: myMap
anchors.fill: parent
extent: sfExtent
focus: true
ArcGISLocalTiledLayer {
path: copyLocalData(inputTPK, outputTPK)
}
}
}