Could not find tools.jar React Native Android In w

2020-05-22 07:21发布

guys . i just try to install react native in my laptop. i've followed all setup instruction but i stiil get those error .

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar

i used genymotion with os version 5.1.0, i've setup environment variable for android_home. Any idea what i miss here ?

sdk manager

10条回答
我只想做你的唯一
2楼-- · 2020-05-22 07:48

Just to add another data point for people pulling their hair out. I think a java update may have messed up my environment that was working fine 2 months ago. The combination of what worked for me:

Set JAVA_HOME to 1.7, NOT 1.8.

I had 2 1.8 versions installed and neither worked.

查看更多
Ridiculous、
3楼-- · 2020-05-22 07:48

I have deleted "\react_native_project_path\android" directory and run

    reactive-native android

then run ..

    reactive-native run-android

Then the error is gone

查看更多
兄弟一词,经得起流年.
4楼-- · 2020-05-22 07:53

I'm gonna go on a long shot here. There is a tools.jar in java libs folder.[the java sdk that is]

Usually all these frameworks and ides have a lib folder themselves. and it is missing said tools.jar. Just copy paste it there.

查看更多
爷、活的狠高调
5楼-- · 2020-05-22 07:54

Setting up appropriate JDK (not JRE. JRE does not have tools.jar) version (E.g. JDK 1.7x) path as the JAVA_HOME would resolve this issue.

Please check your computer's environment variables and set JAVA_HOME if it has not already been setup.

查看更多
登录 后发表回答