Build failed react-native in windows but run fine on developement mode





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am working on a react-native project and it is working fine on development mode (running via react-native run-android) but when I tried to generate unsigned APK using this link I got some errors which I showed below.



I followed the first comment and it is to run this command on root of my project.



react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle
--assets-dest ./android/app/build/intermediates/res/merged/debu


and when it finished run this command in android directory.



gradlew assembleDebug


But when I run gradlew assembleDebug command I got following errors.




error: resource
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored
not found. error: resource
android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:9:5-12:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:13:5-16:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:17:5-93:
AAPT: error: style attribute 'android:attr/keyboardNavigationCluster'
not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/font not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.



error: failed linking references.



FAILURE: Build failed with an exception.





  • What went wrong: Execution failed for task ':react-native-keep-awake:verifyReleaseResources'.




    com.android.ide.common.process.ProcessException: Failed to execute aapt




  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


  • Get more help at https://help.gradle.org



BUILD FAILED in 5m 5s 120 actionable tasks: 22 executed, 98 up-to-date




I have trying it from yesterday and searched about it too much on google and stackoverflow but still not find any suitable solution for it.



Kindly please guide me and help to solve it and please don't give thumbs down to this question because it is different and I haven't find any answer of it and and I have did everything to solve it.



Update



I have added some lines which I found on github and the APK generates successfully but its not installing in my phone.
And these lines are following:



subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}
}


Thank you for your help in advance.










share|improve this question

























  • Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:26











  • Ok I update my answer the build generated but its not installing in my phone.

    – Habib
    Nov 22 '18 at 13:29











  • It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:31











  • No, I moved from this error and now the build generates successfully but I can't install in my phone.

    – Habib
    Nov 22 '18 at 13:33











  • What happens? Get any error?

    – Samitha Nanayakkara
    Nov 22 '18 at 15:31


















0















I am working on a react-native project and it is working fine on development mode (running via react-native run-android) but when I tried to generate unsigned APK using this link I got some errors which I showed below.



I followed the first comment and it is to run this command on root of my project.



react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle
--assets-dest ./android/app/build/intermediates/res/merged/debu


and when it finished run this command in android directory.



gradlew assembleDebug


But when I run gradlew assembleDebug command I got following errors.




error: resource
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored
not found. error: resource
android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:9:5-12:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:13:5-16:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:17:5-93:
AAPT: error: style attribute 'android:attr/keyboardNavigationCluster'
not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/font not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.



error: failed linking references.



FAILURE: Build failed with an exception.





  • What went wrong: Execution failed for task ':react-native-keep-awake:verifyReleaseResources'.




    com.android.ide.common.process.ProcessException: Failed to execute aapt




  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


  • Get more help at https://help.gradle.org



BUILD FAILED in 5m 5s 120 actionable tasks: 22 executed, 98 up-to-date




I have trying it from yesterday and searched about it too much on google and stackoverflow but still not find any suitable solution for it.



Kindly please guide me and help to solve it and please don't give thumbs down to this question because it is different and I haven't find any answer of it and and I have did everything to solve it.



Update



I have added some lines which I found on github and the APK generates successfully but its not installing in my phone.
And these lines are following:



subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}
}


Thank you for your help in advance.










share|improve this question

























  • Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:26











  • Ok I update my answer the build generated but its not installing in my phone.

    – Habib
    Nov 22 '18 at 13:29











  • It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:31











  • No, I moved from this error and now the build generates successfully but I can't install in my phone.

    – Habib
    Nov 22 '18 at 13:33











  • What happens? Get any error?

    – Samitha Nanayakkara
    Nov 22 '18 at 15:31














0












0








0








I am working on a react-native project and it is working fine on development mode (running via react-native run-android) but when I tried to generate unsigned APK using this link I got some errors which I showed below.



I followed the first comment and it is to run this command on root of my project.



react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle
--assets-dest ./android/app/build/intermediates/res/merged/debu


and when it finished run this command in android directory.



gradlew assembleDebug


But when I run gradlew assembleDebug command I got following errors.




error: resource
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored
not found. error: resource
android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:9:5-12:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:13:5-16:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:17:5-93:
AAPT: error: style attribute 'android:attr/keyboardNavigationCluster'
not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/font not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.



error: failed linking references.



FAILURE: Build failed with an exception.





  • What went wrong: Execution failed for task ':react-native-keep-awake:verifyReleaseResources'.




    com.android.ide.common.process.ProcessException: Failed to execute aapt




  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


  • Get more help at https://help.gradle.org



BUILD FAILED in 5m 5s 120 actionable tasks: 22 executed, 98 up-to-date




I have trying it from yesterday and searched about it too much on google and stackoverflow but still not find any suitable solution for it.



Kindly please guide me and help to solve it and please don't give thumbs down to this question because it is different and I haven't find any answer of it and and I have did everything to solve it.



Update



I have added some lines which I found on github and the APK generates successfully but its not installing in my phone.
And these lines are following:



subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}
}


Thank you for your help in advance.










share|improve this question
















I am working on a react-native project and it is working fine on development mode (running via react-native run-android) but when I tried to generate unsigned APK using this link I got some errors which I showed below.



I followed the first comment and it is to run this command on root of my project.



react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle
--assets-dest ./android/app/build/intermediates/res/merged/debu


and when it finished run this command in android directory.



gradlew assembleDebug


But when I run gradlew assembleDebug command I got following errors.




error: resource
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored
not found. error: resource
android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:9:5-12:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:13:5-16:13:
AAPT: error: resource android:attr/colorError not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvalues-v26values-v26.xml:17:5-93:
AAPT: error: style attribute 'android:attr/keyboardNavigationCluster'
not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/font not found.



C:UsersHabib M.
Farooq.gradlecachestransforms-1files-1.1appcompat-v7-27.1.1.aar96831bdc0a7a4525ff0542204eea37bfresvaluesvalues.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.



error: failed linking references.



FAILURE: Build failed with an exception.





  • What went wrong: Execution failed for task ':react-native-keep-awake:verifyReleaseResources'.




    com.android.ide.common.process.ProcessException: Failed to execute aapt




  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


  • Get more help at https://help.gradle.org



BUILD FAILED in 5m 5s 120 actionable tasks: 22 executed, 98 up-to-date




I have trying it from yesterday and searched about it too much on google and stackoverflow but still not find any suitable solution for it.



Kindly please guide me and help to solve it and please don't give thumbs down to this question because it is different and I haven't find any answer of it and and I have did everything to solve it.



Update



I have added some lines which I found on github and the APK generates successfully but its not installing in my phone.
And these lines are following:



subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}
}


Thank you for your help in advance.







react-native build gradlew






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 13:31







Habib

















asked Nov 22 '18 at 12:06









HabibHabib

315414




315414













  • Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:26











  • Ok I update my answer the build generated but its not installing in my phone.

    – Habib
    Nov 22 '18 at 13:29











  • It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:31











  • No, I moved from this error and now the build generates successfully but I can't install in my phone.

    – Habib
    Nov 22 '18 at 13:33











  • What happens? Get any error?

    – Samitha Nanayakkara
    Nov 22 '18 at 15:31



















  • Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:26











  • Ok I update my answer the build generated but its not installing in my phone.

    – Habib
    Nov 22 '18 at 13:29











  • It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

    – Samitha Nanayakkara
    Nov 22 '18 at 13:31











  • No, I moved from this error and now the build generates successfully but I can't install in my phone.

    – Habib
    Nov 22 '18 at 13:33











  • What happens? Get any error?

    – Samitha Nanayakkara
    Nov 22 '18 at 15:31

















Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

– Samitha Nanayakkara
Nov 22 '18 at 13:26





Can you provide the supportLibVersion,compileSDKVersion and things of your android project? You can find that on build.gradle.

– Samitha Nanayakkara
Nov 22 '18 at 13:26













Ok I update my answer the build generated but its not installing in my phone.

– Habib
Nov 22 '18 at 13:29





Ok I update my answer the build generated but its not installing in my phone.

– Habib
Nov 22 '18 at 13:29













It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

– Samitha Nanayakkara
Nov 22 '18 at 13:31





It’s not installing because you are getting this error right? You should provide compatible versions to work an app.

– Samitha Nanayakkara
Nov 22 '18 at 13:31













No, I moved from this error and now the build generates successfully but I can't install in my phone.

– Habib
Nov 22 '18 at 13:33





No, I moved from this error and now the build generates successfully but I can't install in my phone.

– Habib
Nov 22 '18 at 13:33













What happens? Get any error?

– Samitha Nanayakkara
Nov 22 '18 at 15:31





What happens? Get any error?

– Samitha Nanayakkara
Nov 22 '18 at 15:31












1 Answer
1






active

oldest

votes


















0














I think you have used react-native-keep-awake package in your application.



The error is that you have not linked the package properly. So try these



npm install --save react-native-keep-awake

react-native link react-native-keep-awake


And make sure you have removed the previous versions of the react-native-keep-awake from your app. To do so check the following files and remove the added lines.




  • android/settings.gradle

  • android/app/build.gradle

  • android/app/src/main/java/[...]/MainApplication.java






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430650%2fbuild-failed-react-native-in-windows-but-run-fine-on-developement-mode%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I think you have used react-native-keep-awake package in your application.



    The error is that you have not linked the package properly. So try these



    npm install --save react-native-keep-awake

    react-native link react-native-keep-awake


    And make sure you have removed the previous versions of the react-native-keep-awake from your app. To do so check the following files and remove the added lines.




    • android/settings.gradle

    • android/app/build.gradle

    • android/app/src/main/java/[...]/MainApplication.java






    share|improve this answer




























      0














      I think you have used react-native-keep-awake package in your application.



      The error is that you have not linked the package properly. So try these



      npm install --save react-native-keep-awake

      react-native link react-native-keep-awake


      And make sure you have removed the previous versions of the react-native-keep-awake from your app. To do so check the following files and remove the added lines.




      • android/settings.gradle

      • android/app/build.gradle

      • android/app/src/main/java/[...]/MainApplication.java






      share|improve this answer


























        0












        0








        0







        I think you have used react-native-keep-awake package in your application.



        The error is that you have not linked the package properly. So try these



        npm install --save react-native-keep-awake

        react-native link react-native-keep-awake


        And make sure you have removed the previous versions of the react-native-keep-awake from your app. To do so check the following files and remove the added lines.




        • android/settings.gradle

        • android/app/build.gradle

        • android/app/src/main/java/[...]/MainApplication.java






        share|improve this answer













        I think you have used react-native-keep-awake package in your application.



        The error is that you have not linked the package properly. So try these



        npm install --save react-native-keep-awake

        react-native link react-native-keep-awake


        And make sure you have removed the previous versions of the react-native-keep-awake from your app. To do so check the following files and remove the added lines.




        • android/settings.gradle

        • android/app/build.gradle

        • android/app/src/main/java/[...]/MainApplication.java







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 '18 at 14:12









        MatheswaaranMatheswaaran

        727




        727
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430650%2fbuild-failed-react-native-in-windows-but-run-fine-on-developement-mode%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents