Nativescript-cli: No .apk found in /test/platforms/android/build/outputs/apk directory

Created on 20 Jan 2016  路  12Comments  路  Source: NativeScript/nativescript-cli

Creating a empty project with android. After i run tns run android --device 1 i get an error No .apk found in /test/platforms/android/build/outputs/apk directory. But there is an apk.

OS: OSX 10.11.02
CLI Version: 1.5.2

Most helpful comment

Had the same problem, so I removed the platform (tns platform remove android), added it again, all OK now. Of course, I have my assets in app/App-Resources, so blowing away the platform is OK in my case - may not be in yours!

All 12 comments

Hi Do-web. Can I asked why you closed this? What did you do to resolve the issue?

+1

I realized that the apk name and the project name should have the same name
example, project name: Foo
apk name: Foo-debug.apk
I'm not sure if this is the correct place to configure the generated apk name but I did it thru file:

/platforms/android/settings.gradle
entry: rootProject.name = "Foo"

Guys, seems there is some problem when the nativescript.is is not in the form: org.nativescript.XXX.
When named differently the project name in settings.gradle says PROJECT_NAME

I have been trying to build an app for hours now lol. Having the same problem. I am new to NativeScript (Coming from Crapdova... oh I mean Cordova!).

So all I need to do is change my project name in "/platforms/android/settings.gradle"?

This is still an issue for me when trying to run android on iOS. Any suggestions??

Had the same problem, so I removed the platform (tns platform remove android), added it again, all OK now. Of course, I have my assets in app/App-Resources, so blowing away the platform is OK in my case - may not be in yours!

Though the above solution works, it doesn't actually fix this issue. I request the author to reopen this issue. Thanks.

Honestly, this really su*.
An initial part of a project cause to fail when doing a simple tns run android only because of this error:

Unable to apply changes on device: 6PQ0217609002147. Error is: No .apk found in /Users//Documents//platforms/android/app/build/outputs/apk directory.

While the apk is located in when executing the command:
/Users//Documents//platforms/android/app/build/outputs/apk/debug/app-debug.apk.

This needs to be fixed asap IMO

@ole1986,

Can you give us the following information:

  • The version of {N} CLI
  • The content of your package.json file

@Fatme

I came from nativescript-vue and followed the steps from here

$ tns --version
3.4.3

package.json

{
  "name": "******",
  "version": "1.0.0",
  "description": "A native application built with NativeScript-Vue",
  "author": "ole1986 <****>",
  "license": "MIT",
  "nativescript": {
    "id": "org.nativescript.application",
    "tns-ios": {
      "version": "4.2.0"
    },
    "tns-android": {
      "version": "4.2.0"
    }
  },
  "dependencies": {
    "@vue/devtools": "5.0.0-beta.3",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toast": "^1.4.6",
    "nativescript-vue": "^2.0.0",
    "nativescript-vue-devtools": "^1.0.0",
    "tns-core-modules": "^4.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "babel-loader": "^8.0.2",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "clean-webpack-plugin": "^0.1.19",
    "copy-webpack-plugin": "^4.5.2",
    "css-loader": "^1.0.0",
    "lazy": "1.0.11",
    "nativescript-dev-webpack": "0.17.0",
    "nativescript-vue-template-compiler": "^2.0.0",
    "nativescript-worker-loader": "~0.9.0",
    "node-sass": "^4.9.2",
    "sass-loader": "^7.1.0",
    "terser-webpack-plugin": "^1.1.0",
    "vue-loader": "^15.2.6",
    "webpack": "^4.16.4",
    "webpack-bundle-analyzer": "~2.13.1",
    "webpack-cli": "^3.1.0"
  }
}

@ole1986,

Your tns differs in major version from your tns-android.

$ tns --version
3.4.3
"tns-android": {
"version": "4.2.0"
}

Actually the logic for the location of .apk file was changed as of tns-android version 4.0.0. This logic is not backwards compatible with the old logic from {N} CLI and this results in an error with the message No .apk found in <some path>.

You need to update your tns version in order to fix the problem.

Any specific version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Anilinfo2015 picture Anilinfo2015  路  3Comments

ZMW9 picture ZMW9  路  3Comments

jerbob92 picture jerbob92  路  3Comments

erjdriver picture erjdriver  路  3Comments

NickIliev picture NickIliev  路  3Comments