当运行react-native run-android时,它会给出错误执行失败的任务':app:processDebugResources'

时间:2017-09-26 19:51:42

标签: android react-native

我是新手,在开发了一些我试图更新的功能之后使用git更新过程对本机版本做出反应,然后我面临这个错误。我已经完成了类似的问题,但没有一个解决方案给出了任何积极的结果。任何帮助,将不胜感激。在这里我也附上了清单文件。错误指向我的项目名称,其中包含' - '在它。

Scanning 668 folders for symlinks in /home/administrator/x-mobile/node_modules (3ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0484Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
/home/administrator/ncstrax-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:2: AAPT: Tag <manifest> attribute package has invalid character '-'.

/home/administrator/ncstrax-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:18: AAPT: Tag <application> attribute name has invalid character '-'.

/home/administrator/x-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:24: AAPT: Tag <activity> attribute name has invalid character '-'.

/home/administrator/x-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:2: Tag <manifest> attribute package has invalid character '-'.
/home/administrator/x-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:18: Tag <application> attribute name has invalid character '-'.
/home/administrator/x-mobile/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:24: Tag <activity> attribute name has invalid character '-'.

:app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> 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.

BUILD FAILED

Total time: 7.99 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

&#13;
&#13;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.x-mobile"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="22" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <android:uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:name="com.x-mobile.MainApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.x-mobile.MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:windowSoftInputMode="adjustResize" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:1)

  

虽然应用程序ID看起来像传统的Java包   name,应用程序ID的命名规则多一点   限制性的:

     

必须至少有两个片段(一个或多个点)。每个细分   必须以一封信开头。所有字符必须是字母数字或字母   下划线[a-zA-Z0-9 _]。

申请ID中不允许“ - ”:com.x-mobile.MainApplication

For reference

答案 1 :(得分:0)

我知道这个答案可能看起来很奇怪,但我认为你应该导航到这条路径&#39; / home / administrator / ncstrax-mobile / android / app / build / intermediates / manifests / full / debug&#39;在您的PC中确保文件夹保持打开状态,然后运行&#39; react-native run-android&#39;。尝试一下,我希望它有助于解决这个问题。