2017-09-26 101 views
0

我是新來開發一些功能後反應本機我試圖更新反應本地版本使用git更新過程從那時起面臨這個錯誤。我已經經歷了類似的問題,但沒有一個解決方案給出了任何積極的結果。任何幫助,將不勝感激。這裏我也附上清單文件。錯誤指向我的項目名稱,其中有' - '。當運行react-native run-android它給出錯誤執行失敗的任務':app:processDebugResources'

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 

<?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>

+2

您可以發佈您的AndroidManifest.xml?它似乎有什麼問題。 – Kraylog

+0

您的項目名稱是什麼?我敢打賭它的名字是' - ',AndroidManifest.xml引發錯誤 – MattyK14

+0

這對我來說從來沒有問題我做了一些更新我的項目,如反應本地版本從那時我看到這些錯誤@ MattyK14 –

回答

0

雖然應用程序ID看起來像一個傳統的Java包 名稱,爲應用程序ID的命名規則是多一點 限制:

它必須有至少兩個區段(一個或多個點)。每個段 必須以字母開頭。所有字符必須是字母數字或 下劃線[a-zA-Z0-9_]。

號 「 - 」 允許在你的應用程序ID:com.x-mobile.MainApplication

For reference

0

我知道這個答案似乎不可思議,但我認爲你應該轉到這個非常道「的/ home /管理者/ ncstrax移動/安卓/應用/編譯/中間體/清單/完整/調試「,並確保在運行'react-native run-android'之前該文件夾保持打開狀態。試試看,我希望它能幫助解決這個問題。

+1

我確實按照你的指示,但沒有運氣 –

相關問題