{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/559","repository_url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack","labels_url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/559/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/559/comments","events_url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/559/events","html_url":"https://github.com/NativeScript/nativescript-dev-webpack/issues/559","id":330524259,"node_id":"MDU6SXNzdWUzMzA1MjQyNTk=","number":559,"title":"Nativescript 4.1.0 using custom main activity with webpack","user":{"login":"tsonevn","id":17448734,"node_id":"MDQ6VXNlcjE3NDQ4NzM0","avatar_url":"https://avatars3.githubusercontent.com/u/17448734?v=4","gravatar_id":"","url":"https://api.github.com/users/tsonevn","html_url":"https://github.com/tsonevn","followers_url":"https://api.github.com/users/tsonevn/followers","following_url":"https://api.github.com/users/tsonevn/following{/other_user}","gists_url":"https://api.github.com/users/tsonevn/gists{/gist_id}","starred_url":"https://api.github.com/users/tsonevn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsonevn/subscriptions","organizations_url":"https://api.github.com/users/tsonevn/orgs","repos_url":"https://api.github.com/users/tsonevn/repos","events_url":"https://api.github.com/users/tsonevn/events{/privacy}","received_events_url":"https://api.github.com/users/tsonevn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-08T05:28:13Z","updated_at":"2018-06-08T08:30:25Z","closed_at":null,"author_association":"NONE","body":"_From @RadouaneRoufid on June 7, 2018 21:11_\n\n<!--\r\nWe appreciate your feedback! While we are doing all we can to take care of every issue, sometimes we get overwhelmed. That's why\r\n - issues that are not constructive or describe problems that cannot be reproduced will be closed\r\n - feature requests or bug reports with unanswered questions regarding the behavior/reproduction for more than 20 days will be closed \r\n-->\r\n\r\n### Did you verify this is a real problem by searching the [NativeScript Forum](http://forum.nativescript.org) and the [other open issues in this repo](https://github.com/NativeScript/nativescript/issues)?\r\n\r\n### Tell us about the problem\r\nI'm using a custom MainActivity declared as below in my nativescript project in a file named `MainActivity.js`. I'm importing this file in my `vendor-platform.android.ts` and declare this activity as my MainActivity in `AndroidManifest.xml ` as `<activity android:name=\"org.bricool.MainActivity\"...`.\r\n\r\nI updated recently my project from tns 4.0.0 to tns 4.1.0 and nativescript-dev-webpack from 0.10.1 to 0.12.0. When I start the ns app in dev mode (tns run android). The app works fine, but when I build a release bundled, aoted, uglified and snapshoted, the build succeed but tns does not find the MainActivity on start.\r\n\r\n```\r\n@JavaProxy('org.bricool.MainActivity')\r\nexport class Activity extends android.support.v7.app.AppCompatActivity {\r\n...\r\n}\r\n```\r\n\r\nI solved this problem in the previous version of nativescript by doing the following in the webpack.config.js\r\n\r\n```\r\nentry: {\r\n            bundle: aot ?\r\n                `./${nsWebpack.getAotEntryModule(appFullPath)}` :\r\n                `./${nsWebpack.getEntryModule(appFullPath)}`,\r\n            vendor: \"./vendor\",\r\n            [mainSheet]: `./${mainSheet}`,\r\n            MainActivity: \"./MainActivity\"\r\n        },\r\n```\r\nI tried the following with the last version of dev-webpack but it does not work.\r\n\r\n```\r\nentry: {\r\n            bundle: entryPath,\r\nMainActivity: \"./MainActivity\"\r\n        },\r\n```\r\n\r\n### Which platform(s) does your issue occur on?\r\nAndroid\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: 4.1.0\r\n- Cross-platform modules: \"tns-core-modules@4.1.0\",\r\n- Runtime(s): tns-android 4.1.2\r\n- Plugin(s): \r\n\"dependencies\": {\r\n    \"@angular/animations\": \"~5.2.1\",\r\n    \"@angular/common\": \"^5.2.1\",\r\n    \"@angular/compiler\": \"^5.2.1\",\r\n    \"@angular/core\": \"^5.2.1\",\r\n    \"@angular/forms\": \"^5.2.1\",\r\n    \"@angular/http\": \"^5.2.1\",\r\n    \"@angular/platform-browser\": \"^5.2.1\",\r\n    \"@angular/platform-browser-dynamic\": \"^5.2.1\",\r\n    \"@angular/router\": \"^5.2.1\",\r\n    \"@ngrx/effects\": \"^4.1.1\",\r\n    \"@ngrx/router-store\": \"^4.1.1\",\r\n    \"@ngrx/store\": \"^4.1.1\",\r\n    \"@ngrx/store-devtools\": \"^4.1.1\",\r\n    \"@ngx-progressbar/core\": \"^3.0.1\",\r\n    \"@ngx-progressbar/http-client\": \"^3.0.1\",\r\n    \"@ngx-translate/core\": \"^9.1.1\",\r\n    \"@ngx-translate/http-loader\": \"^2.0.1\",\r\n    \"arrive\": \"^2.3.1\",\r\n    \"bootstrap\": \"4.0.0-alpha.6\",\r\n    \"bootstrap-datepicker\": \"1.6.4\",\r\n    \"bootstrap-social\": \"^5.1.1\",\r\n    \"core-js\": \"^2.5.2\",\r\n    \"font-awesome\": \"4.7.0\",\r\n    \"fs\": \"0.0.1-security\",\r\n    \"hammerjs\": \"^2.0.8\",\r\n    \"i\": \"^0.3.6\",\r\n    \"lodash\": \"^4.17.4\",\r\n    \"materialize-css\": \"0.100.2\",\r\n    \"nativescript-angular\": \"~5.2.0\",\r\n    \"nativescript-background-http\": \"^3.2.7\",\r\n    \"nativescript-bottom-navigation\": \"^1.1.2\",\r\n    \"nativescript-bottombar\": \"^3.0.8\",\r\n    \"nativescript-cardview\": \"^2.0.5\",\r\n    \"nativescript-checkbox\": \"^3.0.3\",\r\n    \"nativescript-floatingactionbutton\": \"^4.1.3\",\r\n    \"nativescript-fresco\": \"^3.0.2\",\r\n    \"nativescript-imagepicker\": \"^5.0.0\",\r\n    \"nativescript-localstorage\": \"^1.1.5\",\r\n    \"nativescript-mediafilepicker\": \"^1.0.5\",\r\n    \"nativescript-modal-datetimepicker\": \"^1.1.0\",\r\n    \"nativescript-ng-shadow\": \"^2.1.0\",\r\n    \"nativescript-oauth\": \"^2.1.2\",\r\n    \"nativescript-phone\": \"^1.3.1\",\r\n    \"nativescript-photoviewer\": \"^1.4.0\",\r\n    \"nativescript-snackbar\": \"^2.0.0\",\r\n    \"nativescript-theme-core\": \"~1.0.4\",\r\n    \"nativescript-ui-listview\": \"^3.5.7\",\r\n    \"nativescript-ui-sidedrawer\": \"^4.1.1\",\r\n    \"ng2-validation\": \"^4.2.0\",\r\n    \"ngrx-store-freeze\": \"^0.1.9\",\r\n    \"ngx-pagination\": \"^3.0.3\",\r\n    \"node-sass\": \"^4.9.0\",\r\n    \"npm\": \"^4.2.0\",\r\n    \"osenv\": \"^0.1.4\",\r\n    \"path\": \"^0.12.7\",\r\n    \"reflect-metadata\": \"^0.1.12\",\r\n    \"rxjs\": \"^5.5.5\",\r\n    \"tether\": \"^1.4.3\",\r\n    \"tns-core-modules\": \"^4.1.0\",\r\n    \"url\": \"^0.11.0\",\r\n    \"velocity-animate\": \"^1.5.1\",\r\n    \"zone.js\": \"0.8.5\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@angular-devkit/core\": \"~0.6.3\",\r\n    \"@angular/compiler-cli\": \"^5.2.1\",\r\n    \"@ngtools/webpack\": \"~6.0.8\",\r\n    \"@types/googlemaps\": \"^3.30.8\",\r\n    \"@types/jasmine\": \"^2.8.5\",\r\n    \"babel-traverse\": \"6.26.0\",\r\n    \"babel-types\": \"6.26.0\",\r\n    \"babylon\": \"6.18.0\",\r\n    \"clean-webpack-plugin\": \"~0.1.19\",\r\n    \"copy-webpack-plugin\": \"~4.5.1\",\r\n    \"css-loader\": \"~0.28.11\",\r\n    \"del\": \"^2.2.2\",\r\n    \"extract-text-webpack-plugin\": \"~3.0.2\",\r\n    \"fs-walk\": \"0.0.2\",\r\n    \"gulp\": \"^4.0.0\",\r\n    \"gulp-debug\": \"^3.1.0\",\r\n    \"gulp-exec\": \"^3.0.1\",\r\n    \"gulp-if\": \"^2.0.2\",\r\n    \"gulp-rename\": \"^1.2.2\",\r\n    \"gulp-spawn\": \"^0.4.0\",\r\n    \"gulp-string-replace\": \"^0.4.0\",\r\n    \"lazy\": \"1.0.11\",\r\n    \"mkdirp\": \"^0.5.1\",\r\n    \"nativescript-css-loader\": \"~0.26.1\",\r\n    \"nativescript-dev-android-snapshot\": \"^0.0.11\",\r\n    \"nativescript-dev-sass\": \"^1.6.0\",\r\n    \"nativescript-dev-typescript\": \"~0.7.0\",\r\n    \"nativescript-dev-webpack\": \"^0.12.0\",\r\n    \"nativescript-worker-loader\": \"~0.9.0\",\r\n    \"raw-loader\": \"~0.5.1\",\r\n    \"resolve-url-loader\": \"~2.3.0\",\r\n    \"run-sequence\": \"^2.2.1\",\r\n    \"sass-loader\": \"~6.0.6\",\r\n    \"tns-platform-declarations\": \"^4.1.0\",\r\n    \"typescript\": \"~2.7.2\",\r\n    \"typescript-register\": \"^1.1.0\",\r\n    \"uglifyjs-webpack-plugin\": \"~1.2.5\",\r\n    \"webpack\": \"~4.6.0\",\r\n    \"webpack-bundle-analyzer\": \"^2.13.1\",\r\n    \"webpack-sources\": \"~1.1.0\",\r\n    \"webpack-cli\": \"~2.1.3\"\r\n  },\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\n1- Create a new ns project \r\n2- Create a custom MainActivity\r\n3- build the app with : tns build android --env.profile=mprod --bundle --env.aot --env.uglify --env.snapshot\r\n\r\n\r\n\r\n\n\n_Copied from original issue: NativeScript/NativeScript#5928_"},"comment":{"url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/comments/395689623","html_url":"https://github.com/NativeScript/nativescript-dev-webpack/issues/559#issuecomment-395689623","issue_url":"https://api.github.com/repos/NativeScript/nativescript-dev-webpack/issues/559","id":395689623,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTY4OTYyMw==","user":{"login":"NickIliev","id":18008302,"node_id":"MDQ6VXNlcjE4MDA4MzAy","avatar_url":"https://avatars2.githubusercontent.com/u/18008302?v=4","gravatar_id":"","url":"https://api.github.com/users/NickIliev","html_url":"https://github.com/NickIliev","followers_url":"https://api.github.com/users/NickIliev/followers","following_url":"https://api.github.com/users/NickIliev/following{/other_user}","gists_url":"https://api.github.com/users/NickIliev/gists{/gist_id}","starred_url":"https://api.github.com/users/NickIliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickIliev/subscriptions","organizations_url":"https://api.github.com/users/NickIliev/orgs","repos_url":"https://api.github.com/users/NickIliev/repos","events_url":"https://api.github.com/users/NickIliev/events{/privacy}","received_events_url":"https://api.github.com/users/NickIliev/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T08:30:24Z","updated_at":"2018-06-08T08:30:24Z","author_association":"MEMBER","body":"@RadouaneRoufid I've used [this project](https://github.com/NickIliev/NS-Issues-2018-II/tree/master/nativescript-dev-webpack/extendActivity) for testing purposes, and the webpack bundle was successful at my side.\r\n\r\nThe changes in `webpack.config.` file is [here ](https://github.com/NickIliev/NS-Issues-2018-II/blob/master/nativescript-dev-webpack/extendActivity/webpack.config.js#L17) and [here](https://github.com/NickIliev/NS-Issues-2018-II/blob/master/nativescript-dev-webpack/extendActivity/webpack.config.js#L68).\r\nThis is [the extended activity](https://github.com/NickIliev/NS-Issues-2018-II/blob/master/nativescript-dev-webpack/extendActivity/app/MainActivity.android.ts) used in the application and [here ](https://github.com/NickIliev/NS-Issues-2018-II/blob/master/nativescript-dev-webpack/extendActivity/app/App_Resources/Android/src/main/AndroidManifest.xml#L43)the activity is added in AndoridManifest.xml.\r\n\r\nLet me know if the project is building on your side - you can also used it as a reference."}}
{"actor":{"display_login":"NickIliev"}}